// editor3
#include<iostream>
#include<cctype>
#include<string>
using namespace std;
int main(){
    string s,a="";
    getline(cin,s);
    for(char c : s ){
        if(c == '.' || c == '-'){
            cout<<"INVALID INPUT";
            return 0;
        }
    }
    for(char c : s){
        if(isalnum(c)){
            if(isalpha(c))
              a+=tolower(c);
              else
              a+= c;
        }
}
if(a ==""){
    cout<<"INVALID INPUT";
    return 0;
}
int i=0 , j=a.length() -1;
while(i<j){
    if(a[i] != a[j]){
        cout<<"NO";
        return 0;
    }
    i++;
    j++;
}
cou<<"YES";
return 0;
}