while 1:a,b,c=input().split();print(["NO","YES"][a in b in c])