a = list(input()) b = list(input()) if len(set(a) ^ set(b)) == 0 : print('YES') else : print('NO')