word_one = input().lower()
word_two = input().lower()

if word_one == word_two:
    print("yes")
else:
    print("no")

word_one = input().lower()
word_two = input().lower()

if word_one == word_two:
    print("yes")
else:
    print("no")
