while~0: s,t=raw_input().split() while s[1:]: if s[:1]==t[:1]:s,t=s[1:],t[1:] else:s=`(int(s[0])+int(s[1]))%10`+s[2:] print('YNEOS')[s!=t>''or'0'