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') print(2) else: print('No')