#include #include using namespace std; using namespace atcoder; int main() { int N, M; cin >> N >> M; vector p(N, -1); for (int i = 0; i < M; i++) { int A, B; cin >> A >> B; A--; B--; if (p[A] == -1 && p[B] == -1) { p[A] = 0; p[B] = 1; } else if (p[A] == -1) { p[A] = p[B] ^ 1; } else if (p[B] == -1) { p[B] = p[A] ^ 1; } else if (p[A] == p[B]) { cout << "No"; return 0; } } cout << "Yes"; }