import sys input = sys.stdin.readline 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 != D: if A != E and B != E: A, B = B, A print(2, "C") elif A != F and C != F: A, C = C, A print(2, "B") if B != E and C != F: print(2, "A") else: print("No")