def naiseki(x1,y1,z1,x2,y2,z2)
    if x1-x2+y1-y2+z1-z2 == 0:
        print("YES")
    else:
        print("NO")
f = input().split()
try:
    x1=f[0]
    y1=f[1]
    z1=f[2]
    x2=f[3]
    y2=f[4]
    z2=[f5]
    naiseki(x1,y1,z1,x2,y2,z2)
except:
    print("NO")

    