#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  string s;
  cin>>s;
  string ss="";
  ll x=s.length();
  for(ll i=(x-1);i>=0;i--){
    ss+=s[i];
    }
  for(ll i=0;i<(ll)ss.length();i++){
    if(ss[i]=='6'){ss[i]='9';
                   continue;}
    if(ss[i]=='9')ss[i]='6';
    }
cout<<ss;
  }
#include<bits/stdc++.h>
#define icantcode ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
bool can = 1;
string s;
int main(){
	icantcode
	cin>>s;
	int l = s.length();
	for(int i=0;i<l;i++){
		if(i%2 == 0){
			if(s[i]>='A' && s[i]<='Z'){
				can = 0;
				break;
			} 
		}
		else{
			if(s[i]>='a' && s[i]<='z'){
				can = 0;
				break;
			} 
		}
	}
	if(can) cout<<"Yes";
	else cout<<"No";
	return 0;
}