#include<iostream>
#include<cctype>
using namespace std;
int main()
{
    string s, t="";
    getline(cin,s);
    for (char c:s){
        if(isalnum(c))t+=tolower(c);
        else if(c!=' '&& c!=',')
        {
            cout<<"INVALID INPUT";
            return 0;
            
        }
    }
    string r=t;
    reverse(r.begin() , r.end());
    cout<<(t==r?"YES" : "NO");
    
}