F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Assignment Tools

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 291    Accepted Submission(s): 100


Problem Description
In Valentine¡¯s Day, lovers usually send gifts to their GF or BF. To express their sincerity, they choose DIY.

Small JH want to make a surprise to his GF, so he finds a shop named ¡°DIY Space¡±. But there are so many people scramble for tools to make their gifts. To solve the problem, the boss makes a rule:

1.You will not regain the tool until you can complete all things what you need to do.(If someone has all tools he needs, he will complete immediately. Otherwise, he can¡¯t do anything)

2.If the boss has enough tools he will give you when you need tools.

3.You don't have to queue up.

Small JH should wait until all people leave, because he needs all tools.

People have their tools and never return before completing their tasks. Sometimes it has a state: the boss has no tools any more and everyone can¡¯t get enough tools.

Please tell him whether he should wait.
 

Input
The input consist of several cases, please deal with till the end of file. Each case contains two integers N and M (0 < N, M <= 100), representing there are N kinds of tools and M people. Second line there are N integers, N(i) means the boss own Ni number of ith tool(equal to the number of tools Small JH need).Then follow M lines, each consisting N integers, the number in ith row and jth column means the amount of the jth tools that the ith people need. After it there also M lines, each line has N integers too, the number in ith row and jth column means this amount of jth tools have been allotted to the ith people.

The total number of ith tool that all people own will not bigger than boss own at first.
 

Output
Please print ¡°Yes¡± if Small JH can wait the end, or print ¡°No¡± if he can¡¯t;
 

Sample Input
2 2 10 11 9 8 5 8 2 3 3 5 2 2 10 10 9 8 5 8 2 3 3 5
 

Sample Output
Yes No
 

Author
Tuzkier
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-11 16:55:10, Gzip enabled