# Read the input as strings to handle very large numbers A = input().split() # Check if the first three are the same and the last three are the same a0, a1, a2, a3, a4, a5 = A if (a0 == a1 == a2) and (a3 == a4 == a5): print("NO") else: print("YES")