#include<iostream>
#include<string>
#include<cctype>
using namespace std;
int main()
{
    string s;
    getline(cin,s);
    if(s.length() == 0 || s.length() > 100)
    {
        cout<<"INVALID INPUT";
        return 0;
    }
    string cleaned = "";
    bool hasAlphaNum = false;
    for(char c : s)
    {
        if(isalnum(c))
        {
            cleaned += tolower(c);
            hasAlphaNum = true;
        }
        else if(c==' ' || c ==',' || c=='.')
        {
            continue;
        }
        else
        {
            cout<<"INVALID INPUT";
            return 0;
        }
    }
    if(!hasAlphaNum)
    {
        cout<<"INVALID INPUT";
        return 0;
    }
    int i = 0,j = cleaned.length() - 1;
    while(i<j)
    {
        if(cleared[i] != cleaned[j])
        {
            cout<<"NO";
            return 0;
        }
        i++;
        j--;
    }
    cout<<"YES";
    return 0;
}