char*p,*q;main(s){for(;~scanf("%s%s",p=&s,q=&s+9);puts(*q?"NO":"YES"))for(;*p;*q-48||q++)*q||q--,*q=(*q-*p++)%10+48;}