Problem:
Score : 500 points

Problem Statement

Takahashi is not good at problems about trees in programming contests, and Aoki is helping him practice.

First, Takahashi created a tree with N vertices numbered 1 through N, and wrote 0 at each edge.

Then, Aoki gave him M queries. The i-th of them is as follows:

Increment the number written at each edge along the path connecting vertices a_i and b_i, by one.

After Takahashi executed all of the queries, he told Aoki that, for every edge, the written number became an even number.
However, Aoki forgot to confirm that the graph Takahashi created was actually a tree, and it is possible that Takahashi made a mistake in creating a tree or executing queries.

Determine whether there exists a tree that has the property mentioned by Takahashi.

Constraints

2 ≤ N ≤ 10^5

1 ≤ M ≤ 10^5

1 ≤ a_i,b_i ≤ N

a_i ≠ b_i

Input

Input is given from Standard Input in the following format:

N M
a_1 b_1
:
a_M b_M

Output

Print YES if there exists a tree that has the property mentioned by Takahashi; print NO otherwise.

Sample Input 1

4 4
1 2
2 4
1 3
3 4

Sample Output 1

YES

For example, Takahashi's graph has the property mentioned by him if it has the following edges: 1-2, 1-3 and 1-4.
In this case, the number written at every edge will become 2.

Sample Input 2

5 5
1 2
3 5
5 1
3 4
2 3

Sample Output 2

NO

Solution in Python (3.4.3) (judge verdict: Accepted)

# https://atcoder.jp/contests/agc014/tasks/agc014_b
# 条件を満たすものが存在するかの判別問題

# クエリをグラフにして考えてみる
# a-bを結ぶすべての経路は木上のa-b間の経路を必ず通る
# つまりa-b間の経路の数が偶数である必要がある。すべてのノードに対してエッジが偶数個つながっているかを確認すればよい

import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


N, M = read_ints()

n_edges = [0] * N
for _ in ra(M):
    a, b = read_ints()
    n_edges[a - 1] += 1
    n_edges[b - 1] += 1

for n in n_edges:
    if n & 1:
        print('NO')
        exit()
print('YES')