A,B,C=map(int,input().split()) D,E,F=map(int,input().split()) X=sorted([A,B,C]) Y=sorted([D,E,F]) if X==Y: print("Yes",2,sep="\n") else: print("No")