import itertools A,B,C = map(int,input().split()) D,E,F = map(int,input().split()) P = (A,B,C); PS = set(P) Q = (D,E,F); QS = set(Q) seq = [0,1,2] XX = list(itertools.permutations(Q,3)) Flag = False ans = 3 for X in XX: #print(X) if P == X: Flag = True if X == Q: if len(PS) == 1: ans = 1 elif len(PS) == 2: ans = 1 else: ans = min(2,ans) elif X[0] == Q[0] or X[1] == Q[1] or X[2] == Q[2]: ans = min(1,ans) else: ans = min(2,ans) if not Flag: print("No") else: print("Yes") for i in range(ans): print(2)