str = [input(), input()] sum = 0 for i in range(len(str[0])): for j in range(len(str[1])): if(str[0][i] == str[1][j]): sum += 1 break if(sum == len(str[0])): print('YES') else: print('NO')