A = input() B = input() count = 0 for i in range(len(A)): if A[i] in B: count += 1 else: print('NO') break if len(A) == count: print('YES')