string = input()
palindrome = True
for i in range(1, len(string) // 2):
if string[i - 1] != string[-i]:
palindrome = False
print('Да' if palindrome else 'Нет')
string = input()
palindrome = True
for i in range(1, len(string) // 2):
if string[i - 1] != string[-i]:
palindrome = False
print('Да' if palindrome else 'Нет')