A = input() B = input() if set(A)==set(B): print('YES') else: print('NO')