a,b,c = map(int, input().split())
d,e,f = map(int, input().split())

if {a,b,c} != {d,e,f}:
    print('No')
    exit()

print('Yes')
print(2)