while 1:a,b,c=input().split();print('NYOE\rS'[a in b in c::2])