Under construction

Still being built. Things may change

Found a Troll

Time limit1sMemory limit512 MB

Summary
Given N streamers' viewer trends over M periods, decide whether at least half of the non-Ralpha streamers have an absolute-difference sum above 2000 against Ralpha.
Level

Easy3 of 10

Topics
Array, Simulation, Implementation
Solved
No attempts yet

Problem

Ralpha, a popular streamer known for his colorful curses and cute Southeastern dialect, streams games every day. He once reached the top ranks of a game, but his skill has dropped a lot, and now he fights toxic viewers who keep giving unsolicited advice every day. You have watched Ralpha's streams for a long time, and one day you discovered a shocking fact. Toxic viewers subscribe to many streamers who do not get along with Ralpha. To keep Ralpha's stream clean, you decide to find all of them yourself.

SandwichTV, the platform where Ralpha streams, has a feature: streamers who get along with each other have viewer count changes that follow a similar trend. It is also known that if the sum of the absolute differences in viewer counts over a given period exceeds 20002000, the two streamers do not get along.

For example, suppose the viewer count changes over time for streamers A, B, and C are as follows.

  • A : 1000, 2000, 30001000,\, 2000,\, 3000
  • B : 1100, 2200, 28001100,\, 2200,\, 2800
  • C : 3000, 1000, 40003000,\, 1000,\, 4000

The sum of viewer differences between A and B over the period is 100+200+200=500100 + 200 + 200 = 500, and between A and C it is 2000+1000+1000=40002000 + 1000 + 1000 = 4000. So A and B get along because their sum is 20002000 or less, and A and C do not get along because their sum is greater than 20002000.

If, among the streamers a viewer subscribes to, at least half of the streamers other than Ralpha do not get along with Ralpha, then the viewer is a toxic viewer.

Given the viewer count change trends of all streamers a viewer subscribes to, including Ralpha, write a program that determines whether the viewer is a toxic viewer.

Input

The first line contains the number of streamers NN the viewer subscribes to and the length MM of the viewer count change trend. (2≤N≤10 000,1≤M≤100)(2 \le N \le 10\,000, 1 \le M \le 100)

The second line contains the MM values LjL_j of Ralpha's viewer count change trend. (1≤Lj≤10 000)(1 \le L_j \le 10\,000)

From the third line to line N+1N+1, each line contains the MM values Ki,jK_{i,j} of streamer ii's viewer count change trend. (1≤Ki,j≤10 000)(1 \le K_{i,j} \le 10\,000)

Output

If the viewer is a toxic viewer, print YES. Otherwise, print NO.

Hint

This problem has a large amount of input, so using fast input and output in your language is recommended.

Examples2

  1. Example 1

    Input
    5 3
    1000 2000 3000
    1100 2200 2800
    3000 1000 4000
    4000 500 100
    9999 155 445
    
    Expected output
    YES
    
  2. Example 2

    Input
    3 6
    100 2 300 40 50 62
    56 4 234 10 80 32
    100 39 49 23 45 12
    
    Expected output
    NO