A=list(map(int,input().split())) S=sorted(set(A)) D=dict() for i in range(len(S)): D[S[i]]=i def f(x,y): return 1^(x&y) for i in range(1<<6): x=[(i>>j)&1 for j in range(6)] if f(f(f(x[A[0]],x[A[1]]),x[A[2]]),f(f(x[A[3]],x[A[4]]),x[A[5]])): print('YES') exit() print('NO')