Dirichlet

아직 제출이 없습니다시간 제한2.5초메모리 제한512 MB

문제

Four friends Johann, Peter, Gustav and Lejeune are planning to build a brick wall. They already decided it should be a parallelepiped with one decimeter width and NN decimeters height, but they are still not sure about its length. 

There were TT types of bricks available in the nearest store, and as they have no project of the wall, they simply bought c_ic\_i bricks of type ii for each ii from 11 to TT. A brick of type ii is a parallelepiped of size 1×1×l_i1 \times 1 \times l\_i decimeters.

Due to the stability issues, all of the bricks should be put horizontally. That means each brick will be used in only one level of the wall. To build a wall of height NN, one needs to form NN sets of bricks. Every set can contain arbitrary number of bricks of any type, but the total length of all bricks in any set should be equal among all the sets.

Now friends wonder, whether it is possible to build a wall using all bricks they bought in the store.

입력

The first line of the input contains two integers TT and NN --- the number of brick types and the desired height of the wall respectively (1T51 \leq T \leq 5, 1N101 \leq N \leq 10).

Then follow TT lines describing the types. The ii-th of these lines contains two integers c_ic\_i and l_il\_i --- the number of bricks of type ii bought by the friends and the length of a single brick of this type (1c_i641 \leq c\_i \leq 64, 1l_i1061 \leq l\_i \leq 10^6).

출력

If it is possible to build a wall without breaking any requirements, print "Yes" on a single line of the output. Otherwise, print "No".

힌트

In the first example, the only possible way to construct the wall is to make one level from the only brick of the first type and four bricks of the third type, and another level from all bricks of the second type and one brick of the third type.

Please note that the time limit is harsh. Some extra optimizations may be required to get the problem accepted.