def main(): a, b, c = map(int, input().split()) d, e, f = map(int, input().split()) if a == d and b == e and c == f: print('Yes') print('1 A') print('1 A') elif sorted((a, b, c)) == sorted((d, e, f)): print('Yes') print('2') else: print('No') return if __name__ == '__main__': main()