1 or 2
题号:NC209438
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Bobo has a graph with n vertices and m edges where the i-th edge is between the vertices a_i and b_i. Find out whether is possible for him to choose some of the edges such that the i-th vertex is incident with exactly d_i edges.

输入描述:

The input consists of several test cases terminated by end-of-file.

The first line of each test case contains two integers n and m.
The second line contains n integers .
The i-th of the following m lines contains two integers a_i and b_i.

*
*
*
*
* for
* The number of tests does not exceed 100.

输出描述:

For each test case, print "`Yes`" without quotes if it is possible. Otherwise, print "`No`" without quotes.
示例1

输入

复制
2 1
1 1
1 2
2 1
2 2
1 2
3 2
1 1 2
1 3
2 3

输出

复制
Yes
No
Yes