Code Festival D Compress numbers by mitchs

f=lambda a,b:a==b or''<a[1:]and(a[0]==b[:f(a[1:],b[1:])])|f(`int(a[:2],11)%10`+a[2:],b)
while 1:print'YES'*f(*raw_input().split())or'NO'

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page