Working in corporation is toilsome and rest is important. In leisure time, WisKey like to play Tetris. The Tetris game in board is N*5, and there are 8 kinds of blocks. Look that, red mean the area can’t be place. Other colors mean different kinds of blocks. If I give you C grey blocks (the 1st kind), and other infinite color blocks, Can you fulfil the board without any blocks overlap.
输入解释
Each case will contain two integers N (1<=N<=1000) and C (0<=C<=100). N*5 grid follow it. The ‘1’ represent red area, it can’t be place. The ‘0’ represent normal area. Process cases to end of file.
输出解释
If you can full of the Tetris, print “YES”, otherwise, print “NO”.