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