while 1: a,b=raw_input().split();m=0 for c in a: m+=int(c) if`m%10`==b[:1]:b=b[1:];m=0 print'YNEOS'[''