#abc356b. B - Nutrients

B - Nutrients

Score : 150150 points

问题陈述

高桥非常注重健康,并且关心他是否从饮食中获得了足够的MM种营养素。

对于第ii种营养素,他的目标是每天至少摄入AiA_i单位。

今天,他吃了NN种食物,从第ii种食物中,他摄入了Xi,jX_{i,j}单位的第jj种营养素。

确定他是否达到了所有MM种营养素的目标。

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

Takahashi is health-conscious and concerned about whether he is getting enough of MM types of nutrients from his diet.

For the ii-th nutrient, his goal is to take at least AiA_i units per day.

Today, he ate NN foods, and from the ii-th food, he took Xi,jX_{i,j} units of nutrient jj.

Determine whether he has met the goal for all MM types of nutrients.

Constraints

  • 1N1001 \leq N \leq 100
  • 1M1001 \leq M \leq 100
  • 0Ai,Xi,j1070 \leq A_i, X_{i,j} \leq 10^7
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

NN MM

A1A_1 \ldots AMA_M

X1,1X_{1,1} \ldots X1,MX_{1,M}

\vdots

XN,1X_{N,1} \ldots XN,MX_{N,M}

Output

Print Yes if the goal is met for all MM types of nutrients, and No otherwise.

Sample Input 1

2 3
10 20 30
20 0 10
0 100 100

Sample Output 1

Yes

For nutrient 11, Takahashi took 2020 units from the 11-st food and 00 units from the 22-nd food, totaling 2020 units, thus meeting the goal of taking at least 1010 units.
Similarly, he meets the goal for nutrients 22 and 33.

Sample Input 2

2 4
10 20 30 40
20 0 10 30
0 100 100 0

Sample Output 2

No

The goal is not met for nutrient 44.