Under construction

Still being built. Things may change

Estimathon

Interview

Time limit1sMemory limit1024 MB

Summary
Given the chair count of each colour, decide whether every colour can fill whole tables of four chairs so that exactly n tables are filled.
Level

Easy2 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

Paula and Domagoj are organizing a team competition called Estimathon. They have already prepared the questions and are now arranging the room for the quiz.

Domagoj has already placed nn tables in the room. Now chairs need to be added. The chairs come in mm colours, and there are aia_i chairs of the ii-th colour. Every team has four people, so each table needs exactly four chairs. Paula and Domagoj want the room to look as nice as possible, so they agreed on these conditions:

  • Each table has all of its chairs in the same colour.
  • Every chair colour is used. For every colour, at least one table has chairs of that colour.

The quiz starts soon. Determine whether a chair arrangement that satisfies both conditions is possible.

Input

The first line contains integers nn and mm (1≤n,m≤1001 \le n, m \le 100), the number of tables and the number of chair colours.

The second line contains mm integers aia_i (1≤ai≤1001 \le a_i \le 100), where aia_i is the number of chairs of the ii-th colour.

Output

Print one line containing DA if the chairs can be arranged so that both conditions hold. Otherwise, print NE.

Hint

Clarification of the second sample: Five tables can all be filled with chairs of the same colour, but no table can use colour 4, so the second condition cannot be satisfied.

Examples3

  1. Example 1

    Input
    7 3
    5 21 9
    
    Expected output
    DA
    
  2. Example 2

    Input
    5 4
    8 5 10 3
    
    Expected output
    NE
    
  3. Example 3

    Input
    6 5
    5 5 5 5 5
    
    Expected output
    NE