n = int(input())
m = n % 10
answer = 'YES'
while n != 0:
    if m != n % 10:
        answer = 'NO'
    n = n // 10
print(answer)

d034e05fe62beda815a08b4eef5f01b38a8dc7f3
<mask token>

<mask token>
while n != 0:
    if m != n % 10:
        answer = 'NO'
    n = n // 10
print(answer)

n = int(input())
m = n % 10
answer = 'YES'
while n != 0:
    if m != n % 10:
        answer = 'NO'
    n = n // 10
print(answer)
