print('NYoe s'['000' in ''.join(str(eval(t.replace(*' -'))) for t in open(0
    ))::2])

970178cf79e782bd05a218d01731fe6421d94a31
<mask token>

print('NYoe s'['000' in ''.join(str(eval(t.replace(*' -'))) for t in open(0
    ))::2])
