#include <stdio.h>
#include <ctype.h>
#include <string.h>

// Function to check if a string is a palindrome
int isPalindrome(const char *s) {
    int left = 0;
    int right = strlen(s) - 1;

    while (left < right) {
        // Skip non-alphanumeric characters
        while (left < right && !isalnum(s[left])) left++;
        while (left < right && !isalnum(s[right])) right--;

        // Compare characters (case-insensitive)
        if (tolower(s[left]) != tolower(s[right])) {
            return 0;
        }

        left++;
        right--;
    }

    return 1;
}

int main() {
    char s[1001];

    // Read input string
    fgets(s, sizeof(s), stdin);

    // Check and print result
    if (isPalindrome(s)) {
        printf("YES\n");
    } else {
        printf("NO\n");
    }

    return 0;