#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #define _GLIBCXX_DEBUG #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; #include int main() { int n, m; cin >> n >> m; atcoder::dsu d(2 * n); rep(_, m) { int a, b; cin >> a >> b; --a, --b; d.merge(a, b + n); d.merge(a + n, b); } bool ok = true; rep(i, n) ok &= d.same(i, i + n); cout << (ok ? "Yes" : "No") << endl; return 0; }