#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin >> s;
	int t = s.size();
	int flag=0;
	for(int i=0;i<t;i++){
		if(i%2==0){
			if((s[i]-'Z')<=0){
				flag++;
			}
		}
		else{
			if((s[i]-'Z')>0){
				flag++;
			}
		}
	}
	if(flag>0){
		cout << "No" << endl;
	}
	else{
		cout << "Yes" << endl;
	}
}
#include <bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin>>s;
    for (unsigned int i{};i<s.length()/2;i++){
        char temp = s.at(i);
        s.at(i) = s.at(s.length() - i - 1);
        s.at(s.length() - i - 1) = temp;
    }
    for (unsigned int i{};i<s.length();i++){
        if (s.at(i) == '9'){
            s.at(i) = '6';
        }else if(s.at(i) == '6'){
            s.at(i) = '9';
        }
    }
    cout<<s<<endl;
    return 0;
}