#define _CRT_SECURE_NO_WARNINGS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define Ma_PI 3.141592653589793 #define eps 0.00000000000000000000000001 #define LONG_INF 3000000000000000000 #define GOLD 1.61803398874989484820458 #define MAX_MOD 1000000007 #define REP(i,n) for(long long i = 0;i < n;++i) #define seg_size 524288 int used[200000] = {}; vector vertexs[200000]; int visited[200000] = {}; int main() { int n, m; cin >> n >> m; for (int i = 0;i < m;++i) { int a, b; cin >> a >> b; used[a]++; used[b]++; vertexs[a].push_back(b); vertexs[b].push_back(a); } int foo = 0; for (int i = 1;i <= n;++i) { if (vertexs[i].size() != 0 && visited[i] == false) { visited[i] = true; foo++; queue wow; wow.push(i); while (wow.empty() == false) { int ta = wow.front(); wow.pop(); for (int i = 0;i < vertexs[ta].size();++i) { if (visited[vertexs[ta][i]] == false) { visited[vertexs[ta][i]] = true; wow.push(vertexs[ta][i]); } } } } } if (foo >= 2) { cout << "NO" << endl; return 0; } int tmp = 0; for (int i = 0;i <= n;++i) { if (used[i] % 2 == 1) { tmp++; } } if (tmp >= 3) { cout << "NO" << endl; } else { cout << "YES" << endl; } return 0; }