<>;print grep(/^0.*1( 1|$)/|y/1//>3,$_=<>,y/01/10/r)?Yes:No,$/while<>