A=list(map(lambda n:int(n),input().split(" "))) I=list(set(A)) def s(a,b): return (1-a)*(1-b) def r(a,b,c,d,e,f): return s(s(s(a,b),c),s(s(d,e),f)) def q(): for n in range(64): n = f"{n:0>6b}" if r(*[int(n[I.index(k)]) for k in A]): return "YES" return "NO" print(q())