Under construction

Still being built. Things may change

Are the power strips enough?

Interview

Time limit1sMemory limit512 MB

Summary
Given K power strips with 3 to 8 sockets each, each strip can power at most half its sockets since adjacent sockets cannot both be used; decide if the total reaches N.
Level

Easy3 of 10

Topics
Greedy, Math, Implementation
Solved
No attempts yet

Problem

Today the study group meets, and the place has changed from an Inha University lecture room to the NAVER D2 campus, so Junho, who is in charge of the power strips, has to lay them out before the session starts. The group owns more power strips than the members need, in sizes from 3 sockets up to 8 sockets. Everyone brings only a laptop, so each person uses exactly one socket.

The group has a rule: on one power strip, two neighboring sockets must never be in use at the same time. Junho packed KK power strips so that everyone could plug in. He is not good at arithmetic, so sometimes he brings too few. Decide whether the strips he brought let everyone connect a laptop.

There are KK wall outlets, and each power strip draws power from its own outlet. A power strip is never plugged into another power strip.

Input

The first line contains the number of students NN (1≤N≤1001 \le N \le 100) and the number of power strips KK (1≤K≤1001 \le K \le 100).

The second line contains the socket counts A1,A2,…,AKA_1, A_2, \dots, A_K (3≤Ai≤83 \le A_i \le 8) of the KK power strips, in order.

Output

Print YES if every person can plug in, and NO otherwise.

Examples2

  1. Example 1

    Input
    3 5
    3 4 5 6 7
    
    Expected output
    YES
    
  2. Example 2

    Input
    6 2
    3 4
    
    Expected output
    NO