a,b,c=map(int,input().split()) d,e,f=map(int,input().split()) s=set([a,b,c]) t=set([d,e,f]) if len(s-t)!=0: print('No') else: print('Yes') print(2)