#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    getline(cin, s);
    bool valid = true;
    for(char c : s ){
        if(!isalnum(c)){
            vlaid = false;
            break;
        }
    }
    if(!vlaid){
        cout<<"Invalid"<<endl;
        return 0;
    }
    int left = 0, right = s.length()-1;
    while(left < right){
        if(tolower(s[left])!=tolower(s[right])){
            valid = false;
            break;
        }
        left++;
        right--;
    }
    if(valid){
        cout<<"YES"<<endl;
    }else{
        cout<<"Invalid"<<endl;
    }
    return 0;
}