A, B, C = map(int, input().split()) D, E, F = map(int, input().split()) if sorted([A,B,C])==sorted([D,E,F]): print('Yes') if (A,B,C) != (D,E,F): print(2) else: print(1, 'C') print(1, 'C') else: print('No')