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