#Lutece1399. Reading Book
Reading Book
Migrated from Lutece 1399 Reading Book
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
As we all know, LRZ is a knowledgeable girl, she will spend her spare time reading books. LRZ can read books every day. It is said Gaining New Insight through Reviewing Old Material, LRZ will read any book again after she finish this book once.
The library in LRZ’s university is now allowed to borrow books in a time limit. For the book , we know it will be allowed to borrow in day and lasted days. For example if a book is allowed in day 2 and lasted 3 days, LRZ can borrow it in day 2, 3, 4. LRZ should return any book before day , so if in the day 3, LRZ borrow a book which is allowed to borrow from day 2 and lasted 3 days, she will have 2 days to read this book.
Now you must figure out whether LRZ can read all the books the library allow to borrow.
Input
The first line contains two space-separated integers and (), which are the number of books the library allow to borrow and the number of books LRZ can read every day. The of the following lines contains space-separated integers and ()
Output
If LRZ can read all the book, you just output “Yes”, otherwise output “No”
Samples
3 2
1 3
1 3
1 3
Yes
2 1
1 3
1 3
No
Resources
IEEEXTREME Programming Competition