x=list(map(int,input().split())) if x[0]==x[1]==x[2] and x[3]==x[4]==[5]: print("NO") else: print,("YES")