a = list(input()) b = list(input()) che = [] for i in a: if i in b: che.append(i) b.remove(i) print('YES') if a == che else print('NO')