Kebab House
The young man Vahtang Bumerang makes kebabs at the world-famous fast-food chain Kebab House. Each kebab contains many ingredients.
This morning Vahtang has received an order to make kebabs. At first, he should put ingredients to the first kebab, then ingredients in the second one and so on. Vahtang spends one second to put one ingredient to a kebab, so it takes seconds to make the -th kebab. When he finishes the kebab he immediately proceeds to the next one.
Vahtang often dreams about his lovely boomerang while making kebabs. Each dream takes exactly one second and Vahtang forgets to put one ingredient to kebab during this second. Fortunately, he never dreams twice in any consecutive seconds.
Due to dreams about boomerang, some kebabs may have lesser than the desired number of ingredients, but customers are still happy if the -th kebab has at least ingredients in it.
Vahtang wants to calculate the number of ways to have dream seconds during his work while keeping all customers happy. Can you help him? The real answer may be very huge, so you must calculate it modulo .
Input
The first line contains two integers and — the number of kebabs and minimal possible time between dream seconds.
Each of the next lines contains two integers — the number of ingredients in the -th kebab and the minimum number of ingredients to make the -th customer happy.
Output
Print one integer — the number of ways to distribute dream seconds modulo .