s1 = input().strip();
s2 = input().strip();
if not (s1.replace("","").isalpha()and
s2.replaced("","").isalpha()):
    printf("Invalid input")
elif s1==s2:
    print("yes")
else:
    print("no")