while 1:i=raw_input().split();print('YES'if i[0]in i[1]in i[2]else'NO')