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