Problem:
Sunny Graph
The Sun is a great heavenly body.
The Sun is worshiped by various religions.
Bob loves the Sun and loves any object that is similar to the Sun.
He noticed that he can find the shape of the Sun in certain graphs.
He calls such graphs "Sunny".
We define the property "Sunny" mathematically.
A graph
G=(V,E)
with a vertex
v \in V
is called "Sunny" when there exists a subgraph
G'=(V,E'), E' \subseteq E
that has the following two properties.
(Be careful, the set of vertices must be the same.)
1. The connected component containing
v
is a cycle that consists of three or more vertices.
2. Every other component has exactly two vertices.
The following picture is an example of a subgraph
G'=(V,E')
that has the above property.
Given a simple graph (In each edge, two end points are different. Every pair of vertices has one or no edge.)
G=(V,E)
,
write a program that decides whether the given graph with the vertex
1
is "Sunny" or not.
Input
The first line contains two integers
N
(odd,
1 \leq N \leq 200
) and
M
(
0 \leq M \leq 20,000
), separated by a single space.
N
is the number of the vertices and
M
is the number of the edges.
The following
M
lines describe the edges. Each line contains two integers
v_i
and
u_i
(
1 \leq u_i, v_i \leq N
).
(
u_i, v_i
) indicates the edge that connects the two vertices
u_i
and
v_i
.
u_i
and
v_i
are different, and every pair
(u_i,v_i)
are different.
Output
Print a line containing "Yes" when the graph is "Sunny". Otherwise, print "No".
Sample Input 1
5 5
1 2
2 3
3 4
4 5
1 3
Output for the Sample Input 1
Yes
Sample Input 2
5 5
1 2
2 3
3 4
4 5
1 4
Output for the Sample Input 2
No

Submitted solutions:

code_snippet: #include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))


double GaussElimination(vector<vector<double> > matrix) {
  const int n = matrix.size();
  double ret = 1.0;
  for (int x = 0; x < n; x++) {
    int pivot = x;
    for (int i = x + 1; i < n; i++) {
      if (fabs(matrix[i][x]) - fabs(matrix[pivot][x]) > EPS) {
        pivot = i;
      }
    }
    swap(matrix[x], matrix[pivot]);
    if (fabs(matrix[x][x]) < EPS) { return 0.0; }
    for (int y = 0; y < n; y++) {
      if (y == x) { continue; }
      double ratio = -matrix[y][x] /  matrix[x][x];
      matrix[y][x] = 0.0;
      for (int i = x + 1; i < n; i++) {
        matrix[y][i] += matrix[x][i] * ratio;
      }
    }
  }
  return ret;
}

typedef int Weight;
struct Edge {
  int src;
  int dest;
  Weight weight;
  Edge(int src, int dest, Weight weight) : src(src), dest(dest), weight(weight) {;}
  bool operator<(const Edge &rhs) const {
    if (weight != rhs.weight) { return weight > rhs.weight; }
    if (src != rhs.src) { return src < rhs.src; }
    return dest < rhs.dest;
  }
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
typedef vector<double> Array;
typedef vector<Array> Matrix;

void PrintMatrix(const Matrix &matrix) {
  for (int y = 0; y < (int)matrix.size(); y++) {
    for (int x = 0; x < (int)matrix[y].size(); x++) {
      printf("%f ", matrix[y][x]);
    }
    puts("");
  }
}

const int ITER_CNT = 10;
bool Sunny(const Graph &g) {
  const int n = g.size();
  REP(iter, ITER_CNT) {
    Matrix tutte(n, Array(n, 0));
    REP(from, n) {
      FORIT(it, g[from]) {
        int to = it->dest;
        if (to <= from) { continue; }
        if (from != 0) {
          double r = (double)(rand() + 1) / RAND_MAX;
          tutte[from][to] = r;
          tutte[to][from] = -r;
        } else {
          double r1 = (double)(rand() + 1) / RAND_MAX;
          double r2 = (double)(rand() + 1) / RAND_MAX;
          tutte[from][to] = r1;
          tutte[to][from] = -r2;
        }
      }
    }
    if (GaussElimination(tutte) != 0.0) { return true; }
  }
  return false;
}

int n, m;
int main() {
  while (scanf("%d %d", &n, &m) > 0) {
    Graph g(n);
    REP(i, m) {
      int f, t;
      scanf("%d %d", &f, &t);
      f--; t--;
      g[f].push_back(Edge(f, t, 0));
      g[t].push_back(Edge(t, f, 0));
    }
    if (Sunny(g)) {
      puts("Yes");
    } else {
      puts("No");
    }
  }
}
accuracy: 1
time_ms: 10
memory_kb: 4400
final_rank: 7

code_snippet: // AOJ 2347 Sunny Graph
// 2025.3.1

#include <bits/stdc++.h>
using namespace std;

#define gc() getchar_unlocked()

int Cin() {  // 整数の入力
	int n = 0, c = gc();
	do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

vector<int> bfs_path(int start, int end, int N, const vector<vector<int>> &graph) {
    vector<int> dist(N+1, -1), par(N+1, -1);
    queue<int> q;
    dist[start] = 0;
    q.push(start);
    while(!q.empty()){
        int cur = q.front();
        q.pop();
        if(cur == end) break;
        for (int nxt : graph[cur]) {
            if(nxt == 1) continue;
            if(dist[nxt] == -1) {
                dist[nxt] = dist[cur] + 1;
                par[nxt] = cur;
                q.push(nxt);
            }
        }
    }
    if(dist[end] == -1) return {};
    vector<int> path;
    for (int cur = end; cur != -1; cur = par[cur]) path.push_back(cur);
    reverse(path.begin(), path.end());
    return path;
}


int n_blossom;
vector<vector<int>> g_blossom;
vector<int> match, p, base;
vector<bool> used, bl;

int lca(int a, int b) {
    vector<bool> usedLocal(n_blossom, false);
    while(true) {
        a = base[a];
        usedLocal[a] = true;
        if(match[a] == -1) break;
        a = p[match[a]];
    }
    while(true) {
        b = base[b];
        if(usedLocal[b]) return b;
        b = p[match[b]];
    }
}

void markPath(int v, int b, int x) {
    while(base[v] != b) {
        bl[base[v]] = bl[base[match[v]]] = true;
        p[v] = x;
        x = match[v];
        v = p[match[v]];
    }
}

int findPath(int start) {
    used.assign(n_blossom, false);
    p.assign(n_blossom, -1);
    for (int i = 0; i < n_blossom; i++) base[i] = i;
    queue<int> q;
    q.push(start);
    used[start] = true;
    while(!q.empty()){
        int v = q.front();
        q.pop();
        for (int u : g_blossom[v]) {
            if(base[v] == base[u] || match[v] == u) continue;
            if(u == start || (match[u] != -1 && p[match[u]] != -1)) {
                int cur = lca(v, u);
                bl.assign(n_blossom, false);
                markPath(v, cur, u);
                markPath(u, cur, v);
                for (int i = 0; i < n_blossom; i++) {
                    if(bl[base[i]]) {
                        base[i] = cur;
                        if(!used[i]) {
                            used[i] = true;
                            q.push(i);
                        }
                    }
                }
            } else if(p[u] == -1) {
                p[u] = v;
                if(match[u] == -1) return u;
                used[match[u]] = true;
                q.push(match[u]);
            }
        }
    }
    return -1;
}

int blossomMatching() {
    match.assign(n_blossom, -1);
    int ans = 0;
    for (int i = 0; i < n_blossom; i++) {
        if(match[i] == -1) {
            int v = findPath(i);
            if(v != -1) {
                ans++;
                int cur = v;
                while(cur != -1) {
                    int pv = p[cur];
                    int nxt = match[pv];
                    match[cur] = pv;
                    match[pv] = cur;
                    cur = nxt;
                }
            }
        }
    }
    return ans;
}

bool hasPerfectMatching(const vector<int>& rem, const vector<vector<int>> &graph) {
    int k = rem.size();
    if(k % 2 == 1) return false;
    if(k == 0) return true;
    n_blossom = k;
    g_blossom.assign(k, {});
    vector<unordered_set<int>> adjSet(graph.size());
    for (int i = 1; i < (int)graph.size(); i++) {
        for (int nb : graph[i]) adjSet[i].insert(nb);
    }
    for (int i = 0; i < k; i++){
        for (int j = i+1; j < k; j++){
            int u = rem[i], v = rem[j];
            if(adjSet[u].count(v)) {
                g_blossom[i].push_back(j);
                g_blossom[j].push_back(i);
            }
        }
    }
    base.assign(n_blossom, 0);
    bl.assign(n_blossom, false);
    int msize = blossomMatching();
    return (msize * 2 == k);
}


int main(){
    int N = Cin(), M = Cin();
    vector<vector<int>> graph(N+1);
    for (int i = 0; i < M; i++){
        int u = Cin(), v = Cin();
        graph[u].push_back(v);
        graph[v].push_back(u);
    }

    vector<int> neigh;
    for (int v : graph[1]) neigh.push_back(v);
    sort(neigh.begin(), neigh.end());
    neigh.erase(unique(neigh.begin(), neigh.end()), neigh.end());

    bool valid = false;
    int sz = neigh.size();
    for (int i = 0; i < sz && !valid; i++){
        for (int j = i+1; j < sz && !valid; j++){
            int a = neigh[i], b = neigh[j];
            vector<int> path = bfs_path(a, b, N, graph);
            if(path.empty()) continue;
            if(path.size() & 1) continue;
            unordered_set<int> S;
            S.insert(1);
            for (int v : path) S.insert(v);
            vector<int> rem;
            for (int v = 1; v <= N; v++){
                if(S.find(v) == S.end()) rem.push_back(v);
            }
            if(rem.size() % 2 == 1) continue;
            if(hasPerfectMatching(rem, graph)) {
                valid = true;
                break;
            }
        }
    }
    puts(valid ? "Yes" : "No");
    return 0;
}
accuracy: 1
time_ms: 40
memory_kb: 5360
final_rank: 9

code_snippet: // AOJ 2347 Sunny Graph
// 2025.3.1

#include <bits/stdc++.h>
using namespace std;

vector<int> bfs_path(int start, int end, int N, const vector<vector<int>> &graph) {
    vector<int> dist(N+1, -1), par(N+1, -1);
    queue<int> q;
    dist[start] = 0;
    q.push(start);
    while(!q.empty()){
        int cur = q.front();
        q.pop();
        if(cur == end) break;
        for (int nxt : graph[cur]) {
            if(nxt == 1) continue;
            if(dist[nxt] == -1) {
                dist[nxt] = dist[cur] + 1;
                par[nxt] = cur;
                q.push(nxt);
            }
        }
    }
    if(dist[end] == -1) return {};
    vector<int> path;
    for (int cur = end; cur != -1; cur = par[cur]) path.push_back(cur);
    reverse(path.begin(), path.end());
    return path;
}


int n_blossom;
vector<vector<int>> g_blossom;
vector<int> match, p, base;
vector<bool> used, bl;

int lca(int a, int b) {
    vector<bool> usedLocal(n_blossom, false);
    while(true) {
        a = base[a];
        usedLocal[a] = true;
        if(match[a] == -1) break;
        a = p[match[a]];
    }
    while(true) {
        b = base[b];
        if(usedLocal[b]) return b;
        b = p[match[b]];
    }
}

void markPath(int v, int b, int x) {
    while(base[v] != b) {
        bl[base[v]] = bl[base[match[v]]] = true;
        p[v] = x;
        x = match[v];
        v = p[match[v]];
    }
}

int findPath(int start) {
    used.assign(n_blossom, false);
    p.assign(n_blossom, -1);
    for (int i = 0; i < n_blossom; i++) base[i] = i;
    queue<int> q;
    q.push(start);
    used[start] = true;
    while(!q.empty()){
        int v = q.front();
        q.pop();
        for (int u : g_blossom[v]) {
            if(base[v] == base[u] || match[v] == u) continue;
            if(u == start || (match[u] != -1 && p[match[u]] != -1)) {
                int cur = lca(v, u);
                bl.assign(n_blossom, false);
                markPath(v, cur, u);
                markPath(u, cur, v);
                for (int i = 0; i < n_blossom; i++) {
                    if(bl[base[i]]) {
                        base[i] = cur;
                        if(!used[i]) {
                            used[i] = true;
                            q.push(i);
                        }
                    }
                }
            } else if(p[u] == -1) {
                p[u] = v;
                if(match[u] == -1) return u;
                used[match[u]] = true;
                q.push(match[u]);
            }
        }
    }
    return -1;
}

int blossomMatching() {
    match.assign(n_blossom, -1);
    int ans = 0;
    for (int i = 0; i < n_blossom; i++) {
        if(match[i] == -1) {
            int v = findPath(i);
            if(v != -1) {
                ans++;
                int cur = v;
                while(cur != -1) {
                    int pv = p[cur];
                    int nxt = match[pv];
                    match[cur] = pv;
                    match[pv] = cur;
                    cur = nxt;
                }
            }
        }
    }
    return ans;
}

bool hasPerfectMatching(const vector<int>& rem, const vector<vector<int>> &graph) {
    int k = rem.size();
    if(k % 2 == 1) return false;
    if(k == 0) return true;
    n_blossom = k;
    g_blossom.assign(k, {});
    vector<unordered_set<int>> adjSet(graph.size());
    for (int i = 1; i < (int)graph.size(); i++) {
        for (int nb : graph[i]) adjSet[i].insert(nb);
    }
    for (int i = 0; i < k; i++){
        for (int j = i+1; j < k; j++){
            int u = rem[i], v = rem[j];
            if(adjSet[u].count(v)) {
                g_blossom[i].push_back(j);
                g_blossom[j].push_back(i);
            }
        }
    }
    base.assign(n_blossom, 0);
    bl.assign(n_blossom, false);
    int msize = blossomMatching();
    return (msize * 2 == k);
}


int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);

    int N, M;
    cin >> N >> M;
    vector<vector<int>> graph(N+1);
    for (int i = 0; i < M; i++){
        int u, v;
        cin >> u >> v;
        graph[u].push_back(v);
        graph[v].push_back(u);
    }

    vector<int> neigh;
    for (int v : graph[1]) neigh.push_back(v);
    sort(neigh.begin(), neigh.end());
    neigh.erase(unique(neigh.begin(), neigh.end()), neigh.end());

    bool valid = false;
    int sz = neigh.size();
    for (int i = 0; i < sz && !valid; i++){
        for (int j = i+1; j < sz && !valid; j++){
            int a = neigh[i], b = neigh[j];
            vector<int> path = bfs_path(a, b, N, graph);
            if(path.empty()) continue;
            if(path.size() & 1) continue;
            unordered_set<int> S;
            S.insert(1);
            for (int v : path) S.insert(v);
            vector<int> rem;
            for (int v = 1; v <= N; v++){
                if(S.find(v) == S.end()) rem.push_back(v);
            }
            if(rem.size() % 2 == 1) continue;
            if(hasPerfectMatching(rem, graph)) {
                valid = true;
                break;
            }
        }
    }
    cout << (valid ? "Yes" : "No") << "\n";
    return 0;
}
accuracy: 1
time_ms: 40
memory_kb: 5476
final_rank: 10

code_snippet: #ifndef HIDDEN_IN_VS // 折りたたみ用

// 警告の抑制
#define _CRT_SECURE_NO_WARNINGS

// ライブラリの読み込み
#include <bits/stdc++.h>
using namespace std;

// 型名の短縮
using ll = long long; // -2^63 ～ 2^63 = 9 * 10^18（int は -2^31 ～ 2^31 = 2 * 10^9）
using pii = pair<int, int>;	using pll = pair<ll, ll>;	using pil = pair<int, ll>;	using pli = pair<ll, int>;
using vi = vector<int>;		using vvi = vector<vi>;		using vvvi = vector<vvi>;
using vl = vector<ll>;		using vvl = vector<vl>;		using vvvl = vector<vvl>;
using vb = vector<bool>;	using vvb = vector<vb>;		using vvvb = vector<vvb>;
using vc = vector<char>;	using vvc = vector<vc>;		using vvvc = vector<vvc>;
using vd = vector<double>;	using vvd = vector<vd>;		using vvvd = vector<vvd>;
template <class T> using priority_queue_rev = priority_queue<T, vector<T>, greater<T>>;
using Graph = vvi;

// 定数の定義
const double PI = acos(-1);
const vi DX = { 1, 0, -1, 0 }; // 4 近傍（下，右，上，左）
const vi DY = { 0, 1, 0, -1 };
int INF = 1001001001; ll INFL = 4004004004004004004LL;
double EPS = 1e-12;

// 入出力高速化
struct fast_io { fast_io() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(18); } } fastIOtmp;

// 汎用マクロの定義
#define all(a) (a).begin(), (a).end()
#define sz(x) ((int)(x).size())
#define lbpos(a, x) (int)distance((a).begin(), std::lower_bound(all(a), x))
#define ubpos(a, x) (int)distance((a).begin(), std::upper_bound(all(a), x))
#define Yes(b) {cout << ((b) ? "Yes\n" : "No\n");}
#define rep(i, n) for(int i = 0, i##_len = int(n); i < i##_len; ++i) // 0 から n-1 まで昇順
#define repi(i, s, t) for(int i = int(s), i##_end = int(t); i <= i##_end; ++i) // s から t まで昇順
#define repir(i, s, t) for(int i = int(s), i##_end = int(t); i >= i##_end; --i) // s から t まで降順
#define repe(v, a) for(const auto& v : (a)) // a の全要素（変更不可能）
#define repea(v, a) for(auto& v : (a)) // a の全要素（変更可能）
#define repb(set, d) for(int set = 0; set < (1 << int(d)); ++set) // d ビット全探索（昇順）
#define repp(a) sort(all(a)); for(bool a##_perm = true; a##_perm; a##_perm = next_permutation(all(a))) // a の順列全て（昇順）
#define smod(n, m) ((((n) % (m)) + (m)) % (m)) // 非負mod
#define uniq(a) {sort(all(a)); (a).erase(unique(all(a)), (a).end());} // 重複除去
#define EXIT(a) {cout << (a) << endl; exit(0);} // 強制終了

// 汎用関数の定義
template <class T> inline ll pow(T n, int k) { ll v = 1; rep(i, k) v *= n; return v; }
template <class T> inline bool chmax(T& M, const T& x) { if (M < x) { M = x; return true; } return false; } // 最大値を更新（更新されたら true を返す）
template <class T> inline bool chmin(T& m, const T& x) { if (m > x) { m = x; return true; } return false; } // 最小値を更新（更新されたら true を返す）

// 演算子オーバーロード
template <class T, class U> inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template <class T> inline istream& operator>>(istream& is, vector<T>& v) { repea(x, v) is >> x; return is; }
template <class T> inline vector<T>& operator--(vector<T>& v) { repea(x, v) --x; return v; }
template <class T> inline vector<T>& operator++(vector<T>& v) { repea(x, v) ++x; return v; }

// 手元環境（Visual Studio）
#ifdef _MSC_VER
#include "local.hpp"
// 提出用（gcc）
#else
inline int popcount(int n) { return __builtin_popcount(n); }
inline int popcount(ll n) { return __builtin_popcountll(n); }
inline int lsb(int n) { return n != 0 ? __builtin_ctz(n) : -1; }
inline int lsb(ll n) { return n != 0 ? __builtin_ctzll(n) : -1; }
inline int msb(int n) { return n != 0 ? (31 - __builtin_clz(n)) : -1; }
inline int msb(ll n) { return n != 0 ? (63 - __builtin_clzll(n)) : -1; }
#define gcd __gcd
#define dump(...)
#define dumpel(v)
#define dump_list(v)
#define input_from_file(f)
#define output_to_file(f)
#define Assert(b) { if (!(b)) while (1) cout << "OLE"; }
#endif

#endif // 折りたたみ用


////--------------AtCoder 専用--------------
//#include <atcoder/all>
//using namespace atcoder;
//
//using mint = modint1000000007;
////using mint = modint998244353;
////using mint = modint; // mint::set_mod(m);
//
//istream& operator>>(istream& is, mint& x) { ll x_; is >> x_; x = x_; return is; }
//ostream& operator<<(ostream& os, const mint& x) { os << x.val(); return os; }
//using vm = vector<mint>; using vvm = vector<vm>; using vvvm = vector<vvm>;
////----------------------------------------


#ifndef ATCODER_INTERNAL_MATH_HPP
#define ATCODER_INTERNAL_MATH_HPP 1

#include <utility>

#ifdef _MSC_VER
#include <intrin.h>
#endif

namespace atcoder {

    namespace internal {

        // @param m `1 <= m`
        // @return x mod m
        constexpr long long safe_mod(long long x, long long m) {
            x %= m;
            if (x < 0) x += m;
            return x;
        }

        // Fast modular multiplication by barrett reduction
        // Reference: https://en.wikipedia.org/wiki/Barrett_reduction
        // NOTE: reconsider after Ice Lake
        struct barrett {
            unsigned int _m;
            unsigned long long im;

            // @param m `1 <= m < 2^31`
            explicit barrett(unsigned int m) : _m(m), im((unsigned long long)(-1) / m + 1) {}

            // @return m
            unsigned int umod() const { return _m; }

            // @param a `0 <= a < m`
            // @param b `0 <= b < m`
            // @return `a * b % m`
            unsigned int mul(unsigned int a, unsigned int b) const {
                // [1] m = 1
                // a = b = im = 0, so okay

                // [2] m >= 2
                // im = ceil(2^64 / m)
                // -> im * m = 2^64 + r (0 <= r < m)
                // let z = a*b = c*m + d (0 <= c, d < m)
                // a*b * im = (c*m + d) * im = c*(im*m) + d*im = c*2^64 + c*r + d*im
                // c*r + d*im < m * m + m * im < m * m + 2^64 + m <= 2^64 + m * (m + 1) < 2^64 * 2
                // ((ab * im) >> 64) == c or c + 1
                unsigned long long z = a;
                z *= b;
#ifdef _MSC_VER
                unsigned long long x;
                _umul128(z, im, &x);
#else
                unsigned long long x =
                    (unsigned long long)(((unsigned __int128)(z)*im) >> 64);
#endif
                unsigned int v = (unsigned int)(z - x * _m);
                if (_m <= v) v += _m;
                return v;
            }
        };

        // @param n `0 <= n`
        // @param m `1 <= m`
        // @return `(x ** n) % m`
        constexpr long long pow_mod_constexpr(long long x, long long n, int m) {
            if (m == 1) return 0;
            unsigned int _m = (unsigned int)(m);
            unsigned long long r = 1;
            unsigned long long y = safe_mod(x, m);
            while (n) {
                if (n & 1) r = (r * y) % _m;
                y = (y * y) % _m;
                n >>= 1;
            }
            return r;
        }

        // Reference:
        // M. Forisek and J. Jancina,
        // Fast Primality Testing for Integers That Fit into a Machine Word
        // @param n `0 <= n`
        constexpr bool is_prime_constexpr(int n) {
            if (n <= 1) return false;
            if (n == 2 || n == 7 || n == 61) return true;
            if (n % 2 == 0) return false;
            long long d = n - 1;
            while (d % 2 == 0) d /= 2;
            constexpr long long bases[3] = { 2, 7, 61 };
            for (long long a : bases) {
                long long t = d;
                long long y = pow_mod_constexpr(a, t, n);
                while (t != n - 1 && y != 1 && y != n - 1) {
                    y = y * y % n;
                    t <<= 1;
                }
                if (y != n - 1 && t % 2 == 0) {
                    return false;
                }
            }
            return true;
        }
        template <int n> constexpr bool is_prime = is_prime_constexpr(n);

        // @param b `1 <= b`
        // @return pair(g, x) s.t. g = gcd(a, b), xa = g (mod b), 0 <= x < b/g
        constexpr std::pair<long long, long long> inv_gcd(long long a, long long b) {
            a = safe_mod(a, b);
            if (a == 0) return { b, 0 };

            // Contracts:
            // [1] s - m0 * a = 0 (mod b)
            // [2] t - m1 * a = 0 (mod b)
            // [3] s * |m1| + t * |m0| <= b
            long long s = b, t = a;
            long long m0 = 0, m1 = 1;

            while (t) {
                long long u = s / t;
                s -= t * u;
                m0 -= m1 * u;  // |m1 * u| <= |m1| * s <= b

                // [3]:
                // (s - t * u) * |m1| + t * |m0 - m1 * u|
                // <= s * |m1| - t * u * |m1| + t * (|m0| + |m1| * u)
                // = s * |m1| + t * |m0| <= b

                auto tmp = s;
                s = t;
                t = tmp;
                tmp = m0;
                m0 = m1;
                m1 = tmp;
            }
            // by [3]: |m0| <= b/g
            // by g != b: |m0| < b/g
            if (m0 < 0) m0 += b / s;
            return { s, m0 };
        }

    }  // namespace internal

}  // namespace atcoder

#endif  // ATCODER_INTERNAL_MATH_HPP


#ifndef ATCODER_INTERNAL_TYPE_TRAITS_HPP
#define ATCODER_INTERNAL_TYPE_TRAITS_HPP 1

#include <cassert>
#include <numeric>
#include <type_traits>

namespace atcoder {

    namespace internal {

#ifndef _MSC_VER
        template <class T>
        using is_signed_int128 =
            typename std::conditional<std::is_same<T, __int128_t>::value ||
            std::is_same<T, __int128>::value,
            std::true_type,
            std::false_type>::type;

        template <class T>
        using is_unsigned_int128 =
            typename std::conditional<std::is_same<T, __uint128_t>::value ||
            std::is_same<T, unsigned __int128>::value,
            std::true_type,
            std::false_type>::type;

        template <class T>
        using make_unsigned_int128 =
            typename std::conditional<std::is_same<T, __int128_t>::value,
            __uint128_t,
            unsigned __int128>;

        template <class T>
        using is_integral = typename std::conditional<std::is_integral<T>::value ||
            is_signed_int128<T>::value ||
            is_unsigned_int128<T>::value,
            std::true_type,
            std::false_type>::type;

        template <class T>
        using is_signed_int = typename std::conditional<(is_integral<T>::value&&
            std::is_signed<T>::value) ||
            is_signed_int128<T>::value,
            std::true_type,
            std::false_type>::type;

        template <class T>
        using is_unsigned_int =
            typename std::conditional<(is_integral<T>::value&&
                std::is_unsigned<T>::value) ||
            is_unsigned_int128<T>::value,
            std::true_type,
            std::false_type>::type;

        template <class T>
        using to_unsigned = typename std::conditional<
            is_signed_int128<T>::value,
            make_unsigned_int128<T>,
            typename std::conditional<std::is_signed<T>::value,
            std::make_unsigned<T>,
            std::common_type<T>>::type>::type;

#else

        template <class T> using is_integral = typename std::is_integral<T>;

        template <class T>
        using is_signed_int =
            typename std::conditional<is_integral<T>::value&& std::is_signed<T>::value,
            std::true_type,
            std::false_type>::type;

        template <class T>
        using is_unsigned_int =
            typename std::conditional<is_integral<T>::value&&
            std::is_unsigned<T>::value,
            std::true_type,
            std::false_type>::type;

        template <class T>
        using to_unsigned = typename std::conditional<is_signed_int<T>::value,
            std::make_unsigned<T>,
            std::common_type<T>>::type;

#endif

        template <class T>
        using is_signed_int_t = std::enable_if_t<is_signed_int<T>::value>;

        template <class T>
        using is_unsigned_int_t = std::enable_if_t<is_unsigned_int<T>::value>;

        template <class T> using to_unsigned_t = typename to_unsigned<T>::type;

    }  // namespace internal

}  // namespace atcoder

#endif  // ATCODER_INTERNAL_TYPE_TRAITS_HPP


#ifndef ATCODER_MODINT_HPP
#define ATCODER_MODINT_HPP 1

#include <cassert>
#include <numeric>
#include <type_traits>

#ifdef _MSC_VER
#include <intrin.h>
#endif


namespace atcoder {

    namespace internal {

        struct modint_base {};
        struct static_modint_base : modint_base {};

        template <class T> using is_modint = std::is_base_of<modint_base, T>;
        template <class T> using is_modint_t = std::enable_if_t<is_modint<T>::value>;

    }  // namespace internal

    template <int m, std::enable_if_t<(1 <= m)>* = nullptr>
    struct static_modint : internal::static_modint_base {
        using mint = static_modint;

    public:
        static constexpr int mod() { return m; }
        static mint raw(int v) {
            mint x;
            x._v = v;
            return x;
        }

        static_modint() : _v(0) {}
        template <class T, internal::is_signed_int_t<T>* = nullptr>
        static_modint(T v) {
            long long x = (long long)(v % (long long)(umod()));
            if (x < 0) x += umod();
            _v = (unsigned int)(x);
        }
        template <class T, internal::is_unsigned_int_t<T>* = nullptr>
        static_modint(T v) {
            _v = (unsigned int)(v % umod());
        }

        unsigned int val() const { return _v; }

        mint& operator++() {
            _v++;
            if (_v == umod()) _v = 0;
            return *this;
        }
        mint& operator--() {
            if (_v == 0) _v = umod();
            _v--;
            return *this;
        }
        mint operator++(int) {
            mint result = *this;
            ++* this;
            return result;
        }
        mint operator--(int) {
            mint result = *this;
            --* this;
            return result;
        }

        mint& operator+=(const mint& rhs) {
            _v += rhs._v;
            if (_v >= umod()) _v -= umod();
            return *this;
        }
        mint& operator-=(const mint& rhs) {
            _v -= rhs._v;
            if (_v >= umod()) _v += umod();
            return *this;
        }
        mint& operator*=(const mint& rhs) {
            unsigned long long z = _v;
            z *= rhs._v;
            _v = (unsigned int)(z % umod());
            return *this;
        }
        mint& operator/=(const mint& rhs) { return *this = *this * rhs.inv(); }

        mint operator+() const { return *this; }
        mint operator-() const { return mint() - *this; }

        mint pow(long long n) const {
            assert(0 <= n);
            mint x = *this, r = 1;
            while (n) {
                if (n & 1) r *= x;
                x *= x;
                n >>= 1;
            }
            return r;
        }
        mint inv() const {
            if (prime) {
                assert(_v);
                return pow(umod() - 2);
            }
            else {
                auto eg = internal::inv_gcd(_v, m);
                assert(eg.first == 1);
                return eg.second;
            }
        }

        friend mint operator+(const mint& lhs, const mint& rhs) {
            return mint(lhs) += rhs;
        }
        friend mint operator-(const mint& lhs, const mint& rhs) {
            return mint(lhs) -= rhs;
        }
        friend mint operator*(const mint& lhs, const mint& rhs) {
            return mint(lhs) *= rhs;
        }
        friend mint operator/(const mint& lhs, const mint& rhs) {
            return mint(lhs) /= rhs;
        }
        friend bool operator==(const mint& lhs, const mint& rhs) {
            return lhs._v == rhs._v;
        }
        friend bool operator!=(const mint& lhs, const mint& rhs) {
            return lhs._v != rhs._v;
        }

    private:
        unsigned int _v;
        static constexpr unsigned int umod() { return m; }
        static constexpr bool prime = internal::is_prime<m>;
    };

    template <int id> struct dynamic_modint : internal::modint_base {
        using mint = dynamic_modint;

    public:
        static int mod() { return (int)(bt.umod()); }
        static void set_mod(int m) {
            assert(1 <= m);
            bt = internal::barrett(m);
        }
        static mint raw(int v) {
            mint x;
            x._v = v;
            return x;
        }

        dynamic_modint() : _v(0) {}
        template <class T, internal::is_signed_int_t<T>* = nullptr>
        dynamic_modint(T v) {
            long long x = (long long)(v % (long long)(mod()));
            if (x < 0) x += mod();
            _v = (unsigned int)(x);
        }
        template <class T, internal::is_unsigned_int_t<T>* = nullptr>
        dynamic_modint(T v) {
            _v = (unsigned int)(v % mod());
        }

        unsigned int val() const { return _v; }

        mint& operator++() {
            _v++;
            if (_v == umod()) _v = 0;
            return *this;
        }
        mint& operator--() {
            if (_v == 0) _v = umod();
            _v--;
            return *this;
        }
        mint operator++(int) {
            mint result = *this;
            ++* this;
            return result;
        }
        mint operator--(int) {
            mint result = *this;
            --* this;
            return result;
        }

        mint& operator+=(const mint& rhs) {
            _v += rhs._v;
            if (_v >= umod()) _v -= umod();
            return *this;
        }
        mint& operator-=(const mint& rhs) {
            _v += mod() - rhs._v;
            if (_v >= umod()) _v -= umod();
            return *this;
        }
        mint& operator*=(const mint& rhs) {
            _v = bt.mul(_v, rhs._v);
            return *this;
        }
        mint& operator/=(const mint& rhs) { return *this = *this * rhs.inv(); }

        mint operator+() const { return *this; }
        mint operator-() const { return mint() - *this; }

        mint pow(long long n) const {
            assert(0 <= n);
            mint x = *this, r = 1;
            while (n) {
                if (n & 1) r *= x;
                x *= x;
                n >>= 1;
            }
            return r;
        }
        mint inv() const {
            auto eg = internal::inv_gcd(_v, mod());
            assert(eg.first == 1);
            return eg.second;
        }

        friend mint operator+(const mint& lhs, const mint& rhs) {
            return mint(lhs) += rhs;
        }
        friend mint operator-(const mint& lhs, const mint& rhs) {
            return mint(lhs) -= rhs;
        }
        friend mint operator*(const mint& lhs, const mint& rhs) {
            return mint(lhs) *= rhs;
        }
        friend mint operator/(const mint& lhs, const mint& rhs) {
            return mint(lhs) /= rhs;
        }
        friend bool operator==(const mint& lhs, const mint& rhs) {
            return lhs._v == rhs._v;
        }
        friend bool operator!=(const mint& lhs, const mint& rhs) {
            return lhs._v != rhs._v;
        }

    private:
        unsigned int _v;
        static internal::barrett bt;
        static unsigned int umod() { return bt.umod(); }
    };
    template <int id> internal::barrett dynamic_modint<id>::bt(998244353);

    using modint998244353 = static_modint<998244353>;
    using modint1000000007 = static_modint<1000000007>;
    using modint = dynamic_modint<-1>;

    namespace internal {

        template <class T>
        using is_static_modint = std::is_base_of<internal::static_modint_base, T>;

        template <class T>
        using is_static_modint_t = std::enable_if_t<is_static_modint<T>::value>;

        template <class> struct is_dynamic_modint : public std::false_type {};
        template <int id>
        struct is_dynamic_modint<dynamic_modint<id>> : public std::true_type {};

        template <class T>
        using is_dynamic_modint_t = std::enable_if_t<is_dynamic_modint<T>::value>;

    }  // namespace internal

}  // namespace atcoder

#endif  // ATCODER_MODINT_HPP


using namespace atcoder;

using mint = modint1000000007;
//using mint = modint998244353;
//using mint = modint; // mint::set_mod(m);

istream& operator>>(istream& is, mint& x) { ll x_; is >> x_; x = x_; return is; }
ostream& operator<<(ostream& os, const mint& x) { os << x.val(); return os; }
using vm = vector<mint>; using vvm = vector<vm>; using vvvm = vector<vvm>;


//【グラフの入力】O(|V| + |E|)
/*
* (始点, 終点) の組からなる入力を受け取り，n 頂点 m 辺のグラフを構築して返す．
*
* n : グラフの頂点の数
* m : グラフの辺の数（省略すれば n-1）
* undirected : 無向グラフか（省略すれば true）
* one_indexed : 入力が 1-indexed か（省略すれば true）
*/
Graph read_Graph(int n, int m = -1, bool undirected = true, bool one_indexed = true) {
    // verify : https://codeforces.com/contest/764/problem/C

    Graph g(n);
    if (m == -1) m = n - 1;

    rep(i, m) {
        int a, b;
        cin >> a >> b;

        if (one_indexed) { --a; --b; }

        g[a].push_back(b);
        if (undirected) g[b].push_back(a);
    }

    return g;
}


//【誘導部分グラフ】O(|V| + |E|)
/*
* グラフ g について，頂点集合を vs とする誘導部分グラフを返す．
*/
template <class G>
G induced_subgraph(const G& g, const vi& vs) {
    // verify : https://atcoder.jp/contests/abc253/tasks/abc253_h

    int n = sz(g), n2 = sz(vs);

    // id[v] : g の頂点が誘導部分グラフの何番目の頂点に対応するか（無ければ -1）
    vi id(n, -1);
    rep(i, n2) id[vs[i]] = i;

    G g2(n2);

    // 選ばれていない頂点は無視しながら g2 に誘導部分グラフを構築する．
    rep(s, n) {
        if (id[s] == -1) continue;

        repe(t, g[s]) {
            if (id[t] == -1) continue;

            g2[id[s]].push_back(id[t]);
        }
    }

    return g2;
}


//【行列】
/*
* 行列を表す構造体
*
* Matrix(m, n) : O(m n)
*	m * n 零行列で初期化する．
*
* Matrix(n) : O(n^2)
*	n * n 単位行列で初期化する．
*
* Matrix(a) : O(m n)
*	配列 a の要素で初期化する．
*
* A + B : O(m n)
*	m * n 行列 A, B の和を返す．+= も使用可．
*
* A - B : O(m n)
*	m * n 行列 A, B の差を返す．-= も使用可．
*
* c * A ／ A * c : O(m n)
*	m * n 行列 A とスカラー c のスカラー積を返す．*= も使用可．
*
* A * x : O(m n)
*	m * n 行列 A と n 次元列ベクトル x の積を返す．
*
* x * A : O(m n)
*	m 次元行ベクトル x と m * n 行列 A の積を返す．
*
* A * B : O(l m n)
*	l * m 行列 A と m * n 行列 B の積を返す．
*
* pow(d) : O(n^3 log d)
*	自身を d 乗した行列を返す．
*/
template <class T> struct Matrix {
	int m, n; // 行列のサイズ（m 行 n 列）
	vector<vector<T>> v; // 行列の成分

	// コンストラクタ（初期化なし，零行列，単位行列，二次元配列）
	Matrix() : m(0), n(0) {}
	Matrix(const int& m_, const int& n_) : m(m_), n(n_), v(m_, vector<T>(n_)) {}
	Matrix(const int& n_) : m(n_), n(n_), v(n_, vector<T>(n_)) { rep(i, n) v[i][i] = 1; }
	Matrix(const vector<vector<T>>& a) : m(sz(a)), n(sz(a[0])), v(a) {}

	// 代入
	Matrix(const Matrix& b) = default;
	Matrix& operator=(const Matrix& b) = default;

	// 入力
	friend istream& operator>>(istream& is, Matrix& a) {
		rep(i, a.m) rep(j, a.n) is >> a.v[i][j];
		return is;
	}

	// アクセス
	vector<T> const& operator[](int i) const { return v[i]; }
	vector<T>& operator[](int i) { return v[i]; }

	// 比較
	bool operator==(const Matrix& b) const { return m == b.m && n == b.n && v == b.v; }
	bool operator!=(const Matrix& b) const { return !(*this == b); }

	// 加算，減算，スカラー倍
	Matrix& operator+=(const Matrix& b) {
		rep(i, m) rep(j, n) v[i][j] += b.v[i][j];
		return *this;
	}
	Matrix& operator-=(const Matrix& b) {
		rep(i, m) rep(j, n) v[i][j] -= b.v[i][j];
		return *this;
	}
	Matrix& operator*=(const T& c) {
		rep(i, m) rep(j, n) v[i][j] *= c;
		return *this;
	}
	Matrix operator+(const Matrix& b) const { return Matrix(*this) += b; }
	Matrix operator-(const Matrix& b) const { return Matrix(*this) -= b; }
	Matrix operator*(const T& c) const { return Matrix(*this) *= c; }
	friend Matrix operator*(const T& c, const Matrix<T>& a) { return a * c; }
	Matrix operator-() const { return Matrix(*this) *= T(-1); }

	// 行列ベクトル積 : O(m n)
	vector<T> operator*(const vector<T>& x) const {
		vector<T> y(m);
		rep(i, m) rep(j, n)	y[i] += v[i][j] * x[j];
		return y;
	}

	// ベクトル行列積 : O(m n)
	friend vector<T> operator*(const vector<T>& x, const Matrix& a) {
		vector<T> y(a.n);
		rep(i, a.m) rep(j, a.n) y[j] += x[i] * a.v[i][j];
		return y;
	}

	// 積：O(n^3)
	Matrix operator*(const Matrix& b) const {
		// verify : https://judge.yosupo.jp/problem/matrix_product

		Matrix res(m, b.n);
		rep(i, res.m) rep(j, res.n) rep(k, n) res.v[i][j] += v[i][k] * b.v[k][j];
		return res;
	}
	Matrix& operator*=(const Matrix& b) { *this = *this * b; return *this; }

	// 累乗：O(n^3 log d)
	Matrix pow(ll d) const {
		Matrix res(n), pow2 = *this;
		while (d > 0) {
			if ((d & 1) != 0) res *= pow2;
			pow2 *= pow2;
			d /= 2;
		}
		return res;
	}

#ifdef _MSC_VER
	friend ostream& operator<<(ostream& os, const Matrix& a) {
		rep(i, a.m) {
			rep(j, a.n) os << a.v[i][j] << " ";
			os << endl;
		}
		return os;
	}

	// Mathematica の書式に合わせた出力
	void print() const {
		cerr << "{\n";
		rep(i, m) {
			cerr << "{";
			rep(j, n) cerr << v[i][j] << (j < n - 1 ? "," : "}");
			cerr << (i < m - 1 ? ",\n" : "\n");
		}
		cerr << "}\n";
	}
#endif
};


//【行列式】O(n^3)
/*
* n 次正方行列 mat の行列式を返す．
*/
template <class T> T determinant(Matrix<T>& mat) {
	// verify : https://judge.yosupo.jp/problem/matrix_det

	int n = mat.n;
	auto& v = mat.v;

	// 注目位置を (i, j)（i 行目かつ j 列目）とする．
	int i = 0, j = 0;

	// 行列式の値
	T res = 1;

	while (i < n && j < n) {
		// 同じ列の下方の行から非 0 成分を見つける．
		int k = i;
		while (k < n && v[k][j] == 0) k++;

		// 見つからなかったら零列ベクトルを含むので行列式は 0 である．
		if (k == n) return T(0);

		// 見つかったら i 行目とその行を入れ替える．
		// 行列式の値は -1 倍しておく．
		if (k != i) {
			swap(v[i], v[k]);
			res *= T(-1);
		}

		// v[i][j] が 1 になるよう行全体を v[i][j] で割る．
		// 行列式の値は v[i][j] 倍しておく．
		T div = v[i][j];
		repi(t, j, n - 1) v[i][t] /= div;
		res *= div;

		// v[i][j] より下方の行の成分が全て 0 になるよう i 行目を定数倍して減じる．
		// 行列式の値は変化しない．
		repi(k, i + 1, n - 1) {
			T mul = v[k][j];
			repi(t, j, n - 1) v[k][t] -= v[i][t] * mul;
		}

		// 注目位置を右下に移す．
		i++; j++;
	}

	return res;
}


int main() {
//	input_from_file("input.txt");
//	output_to_file("output.txt");
	
	int n, m;
	cin >> n >> m;

	Graph g = read_Graph(n, m);

	auto start = chrono::system_clock::now();

	vi p(n, -1);
	vector<pii> es;

	vi dist(n, INF); // スタートからの最短距離を保持するテーブル : O(n)
	dist[0] = 0;

	queue<int> que; // 次に探索する頂点を入れておくキュー
	que.push(0);

	while (!que.empty()) {
		// 未探索の頂点を 1 つ得る．
		auto s = que.front(); que.pop();

		repe(t, g[s]) {
			if (dist[t] == dist[s] && s < t) {
				es.emplace_back(s, t);
				continue;
			}

			// 発見済みの頂点なら何もしない．
			if (dist[t] != INF) continue;

			// スタートからの最短距離を確定する．
			// 幅優先探索なので，最短だという保証がある．
			dist[t] = dist[s] + 1;
			p[t] = s;

			// 未探索の頂点として t を追加する．
			que.push(t);
		}
	}
	dump(dist); dump(p); dump(es);

	mt19937_64 mt((int)time(NULL));
	uniform_int_distribution<int> rnd(1, (int)1e9);

	shuffle(all(es), mt);

	repe(e, es) {
		int v1, v2;
		tie(v1, v2) = e;

		vi v_el{0};
		while (v1 != 0) {
			v_el.emplace_back(v1);
			v1 = p[v1];
		}
		while (v2 != 0) {
			v_el.emplace_back(v2);
			v2 = p[v2];
		}
        uniq(v_el);

        vi v_all(n), v_rmd;
        iota(all(v_all), 0);
        set_difference(all(v_all), all(v_el), inserter(v_rmd, v_rmd.end()));

		Graph g2 = induced_subgraph(g, v_rmd);
        int n2 = sz(g2);
		dumpel(g2);

		Matrix<mint> mat(n2, n2);
		rep(s, n2) {
			repe(t, g2[s]) {
				if (s > t) continue;

				int x = rnd(mt);
				mat[s][t] = x;
				mat[t][s] = -x;
			}
		}

		mint det = determinant(mat);

		if (det != 0) EXIT("Yes");

		auto now = chrono::system_clock::now();
		auto msec = chrono::duration_cast<std::chrono::milliseconds>(now - start).count();
		if (msec >= 2800) break;
	}

	EXIT("No");
}
accuracy: 1
time_ms: 1480
memory_kb: 4136
final_rank: 11

code_snippet: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mp make_pair
#define si(x) int(x.size())
const int mod=998244353,MAX=105;
const ll INF=1LL<<60;

//modintのみ

// from: https://gist.github.com/yosupo06/ddd51afb727600fd95d9d8ad6c3c80c9
// (based on AtCoder STL)

#include <cassert>
#include <numeric>
#include <type_traits>

namespace atcoder {
    
    namespace internal {
        
#ifndef _MSC_VER
        template <class T>
        using is_signed_int128 =
        typename std::conditional<std::is_same<T, __int128_t>::value ||
        std::is_same<T, __int128>::value,
        std::true_type,
        std::false_type>::type;
        
        template <class T>
        using is_unsigned_int128 =
        typename std::conditional<std::is_same<T, __uint128_t>::value ||
        std::is_same<T, unsigned __int128>::value,
        std::true_type,
        std::false_type>::type;
        
        template <class T>
        using make_unsigned_int128 =
        typename std::conditional<std::is_same<T, __int128_t>::value,
        __uint128_t,
        unsigned __int128>;
        
        template <class T>
        using is_integral = typename std::conditional<std::is_integral<T>::value ||
        is_signed_int128<T>::value ||
        is_unsigned_int128<T>::value,
        std::true_type,
        std::false_type>::type;
        
        template <class T>
        using is_signed_int = typename std::conditional<(is_integral<T>::value &&
                                                         std::is_signed<T>::value) ||
        is_signed_int128<T>::value,
        std::true_type,
        std::false_type>::type;
        
        template <class T>
        using is_unsigned_int =
        typename std::conditional<(is_integral<T>::value &&
                                   std::is_unsigned<T>::value) ||
        is_unsigned_int128<T>::value,
        std::true_type,
        std::false_type>::type;
        
        template <class T>
        using to_unsigned = typename std::conditional<
        is_signed_int128<T>::value,
        make_unsigned_int128<T>,
        typename std::conditional<std::is_signed<T>::value,
        std::make_unsigned<T>,
        std::common_type<T>>::type>::type;
        
#else
        
        template <class T> using is_integral = typename std::is_integral<T>;
        
        template <class T>
        using is_signed_int =
        typename std::conditional<is_integral<T>::value && std::is_signed<T>::value,
        std::true_type,
        std::false_type>::type;
        
        template <class T>
        using is_unsigned_int =
        typename std::conditional<is_integral<T>::value &&
        std::is_unsigned<T>::value,
        std::true_type,
        std::false_type>::type;
        
        template <class T>
        using to_unsigned = typename std::conditional<is_signed_int<T>::value,
        std::make_unsigned<T>,
        std::common_type<T>>::type;
        
#endif
        
        template <class T>
        using is_signed_int_t = std::enable_if_t<is_signed_int<T>::value>;
        
        template <class T>
        using is_unsigned_int_t = std::enable_if_t<is_unsigned_int<T>::value>;
        
        template <class T> using to_unsigned_t = typename to_unsigned<T>::type;
        
    }  // namespace internal
    
}  // namespace atcoder

#include <utility>

namespace atcoder {
    
    namespace internal {
        
        constexpr long long safe_mod(long long x, long long m) {
            x %= m;
            if (x < 0) x += m;
            return x;
        }
        
        struct barrett {
            unsigned int _m;
            unsigned long long im;
            
            barrett(unsigned int m) : _m(m), im((unsigned long long)(-1) / m + 1) {}
            
            unsigned int umod() const { return _m; }
            
            unsigned int mul(unsigned int a, unsigned int b) const {
                
                unsigned long long z = a;
                z *= b;
#ifdef _MSC_VER
                unsigned long long x;
                _umul128(z, im, &x);
#else
                unsigned long long x =
                (unsigned long long)(((unsigned __int128)(z)*im) >> 64);
#endif
                unsigned int v = (unsigned int)(z - x * _m);
                if (_m <= v) v += _m;
                return v;
            }
        };
        
        constexpr long long pow_mod_constexpr(long long x, long long n, int m) {
            if (m == 1) return 0;
            unsigned int _m = (unsigned int)(m);
            unsigned long long r = 1;
            unsigned long long y = safe_mod(x, m);
            while (n) {
                if (n & 1) r = (r * y) % _m;
                y = (y * y) % _m;
                n >>= 1;
            }
            return r;
        }
        
        constexpr bool is_prime_constexpr(int n) {
            if (n <= 1) return false;
            if (n == 2 || n == 7 || n == 61) return true;
            if (n % 2 == 0) return false;
            long long d = n - 1;
            while (d % 2 == 0) d /= 2;
            for (long long a : {2, 7, 61}) {
                long long t = d;
                long long y = pow_mod_constexpr(a, t, n);
                while (t != n - 1 && y != 1 && y != n - 1) {
                    y = y * y % n;
                    t <<= 1;
                }
                if (y != n - 1 && t % 2 == 0) {
                    return false;
                }
            }
            return true;
        }
        template <int n> constexpr bool is_prime = is_prime_constexpr(n);
        
        constexpr std::pair<long long, long long> inv_gcd(long long a, long long b) {
            a = safe_mod(a, b);
            if (a == 0) return {b, 0};
            
            long long s = b, t = a;
            long long m0 = 0, m1 = 1;
            
            while (t) {
                long long u = s / t;
                s -= t * u;
                m0 -= m1 * u;  // |m1 * u| <= |m1| * s <= b
                
                
                auto tmp = s;
                s = t;
                t = tmp;
                tmp = m0;
                m0 = m1;
                m1 = tmp;
            }
            if (m0 < 0) m0 += b / s;
            return {s, m0};
        }
        
        constexpr int primitive_root_constexpr(int m) {
            if (m == 2) return 1;
            if (m == 167772161) return 3;
            if (m == 469762049) return 3;
            if (m == 754974721) return 11;
            if (m == 998244353) return 3;
            int divs[20] = {};
            divs[0] = 2;
            int cnt = 1;
            int x = (m - 1) / 2;
            while (x % 2 == 0) x /= 2;
            for (int i = 3; (long long)(i)*i <= x; i += 2) {
                if (x % i == 0) {
                    divs[cnt++] = i;
                    while (x % i == 0) {
                        x /= i;
                    }
                }
            }
            if (x > 1) {
                divs[cnt++] = x;
            }
            for (int g = 2;; g++) {
                bool ok = true;
                for (int i = 0; i < cnt; i++) {
                    if (pow_mod_constexpr(g, (m - 1) / divs[i], m) == 1) {
                        ok = false;
                        break;
                    }
                }
                if (ok) return g;
            }
        }
        template <int m> constexpr int primitive_root = primitive_root_constexpr(m);
        
    }  // namespace internal
    
}  // namespace atcoder

#include <cassert>
#include <numeric>
#include <type_traits>

#ifdef _MSC_VER
#include <intrin.h>
#endif

namespace atcoder {
    
    namespace internal {
        
        struct modint_base {};
        struct static_modint_base : modint_base {};
        
        template <class T> using is_modint = std::is_base_of<modint_base, T>;
        template <class T> using is_modint_t = std::enable_if_t<is_modint<T>::value>;
        
    }  // namespace internal
    
    template <int m, std::enable_if_t<(1 <= m)>* = nullptr>
    struct static_modint : internal::static_modint_base {
        using mint = static_modint;
        
    public:
        static constexpr int mod() { return m; }
        static mint raw(int v) {
            mint x;
            x._v = v;
            return x;
        }
        
        static_modint() : _v(0) {}
        template <class T, internal::is_signed_int_t<T>* = nullptr>
        static_modint(T v) {
            long long x = (long long)(v % (long long)(umod()));
            if (x < 0) x += umod();
            _v = (unsigned int)(x);
        }
        template <class T, internal::is_unsigned_int_t<T>* = nullptr>
        static_modint(T v) {
            _v = (unsigned int)(v % umod());
        }
        static_modint(bool v) { _v = ((unsigned int)(v) % umod()); }
        
        unsigned int val() const { return _v; }
        
        mint& operator++() {
            _v++;
            if (_v == umod()) _v = 0;
            return *this;
        }
        mint& operator--() {
            if (_v == 0) _v = umod();
            _v--;
            return *this;
        }
        mint operator++(int) {
            mint result = *this;
            ++*this;
            return result;
        }
        mint operator--(int) {
            mint result = *this;
            --*this;
            return result;
        }
        
        mint& operator+=(const mint& rhs) {
            _v += rhs._v;
            if (_v >= umod()) _v -= umod();
            return *this;
        }
        mint& operator-=(const mint& rhs) {
            _v -= rhs._v;
            if (_v >= umod()) _v += umod();
            return *this;
        }
        mint& operator*=(const mint& rhs) {
            unsigned long long z = _v;
            z *= rhs._v;
            _v = (unsigned int)(z % umod());
            return *this;
        }
        mint& operator/=(const mint& rhs) { return *this = *this * rhs.inv(); }
        
        mint operator+() const { return *this; }
        mint operator-() const { return mint() - *this; }
        
        mint pow(long long n) const {
            assert(0 <= n);
            mint x = *this, r = 1;
            while (n) {
                if (n & 1) r *= x;
                x *= x;
                n >>= 1;
            }
            return r;
        }
        mint inv() const {
            if (prime) {
                assert(_v);
                return pow(umod() - 2);
            } else {
                auto eg = internal::inv_gcd(_v, m);
                assert(eg.first == 1);
                return eg.second;
            }
        }
        
        friend mint operator+(const mint& lhs, const mint& rhs) {
            return mint(lhs) += rhs;
        }
        friend mint operator-(const mint& lhs, const mint& rhs) {
            return mint(lhs) -= rhs;
        }
        friend mint operator*(const mint& lhs, const mint& rhs) {
            return mint(lhs) *= rhs;
        }
        friend mint operator/(const mint& lhs, const mint& rhs) {
            return mint(lhs) /= rhs;
        }
        friend bool operator==(const mint& lhs, const mint& rhs) {
            return lhs._v == rhs._v;
        }
        friend bool operator!=(const mint& lhs, const mint& rhs) {
            return lhs._v != rhs._v;
        }
        
    private:
        unsigned int _v;
        static constexpr unsigned int umod() { return m; }
        static constexpr bool prime = internal::is_prime<m>;
    };
    
    template <int id> struct dynamic_modint : internal::modint_base {
        using mint = dynamic_modint;
        
    public:
        static int mod() { return (int)(bt.umod()); }
        static void set_mod(int m) {
            assert(1 <= m);
            bt = internal::barrett(m);
        }
        static mint raw(int v) {
            mint x;
            x._v = v;
            return x;
        }
        
        dynamic_modint() : _v(0) {}
        template <class T, internal::is_signed_int_t<T>* = nullptr>
        dynamic_modint(T v) {
            long long x = (long long)(v % (long long)(mod()));
            if (x < 0) x += mod();
            _v = (unsigned int)(x);
        }
        template <class T, internal::is_unsigned_int_t<T>* = nullptr>
        dynamic_modint(T v) {
            _v = (unsigned int)(v % mod());
        }
        dynamic_modint(bool v) { _v = ((unsigned int)(v) % mod()); }
        
        unsigned int val() const { return _v; }
        
        mint& operator++() {
            _v++;
            if (_v == umod()) _v = 0;
            return *this;
        }
        mint& operator--() {
            if (_v == 0) _v = umod();
            _v--;
            return *this;
        }
        mint operator++(int) {
            mint result = *this;
            ++*this;
            return result;
        }
        mint operator--(int) {
            mint result = *this;
            --*this;
            return result;
        }
        
        mint& operator+=(const mint& rhs) {
            _v += rhs._v;
            if (_v >= umod()) _v -= umod();
            return *this;
        }
        mint& operator-=(const mint& rhs) {
            _v += mod() - rhs._v;
            if (_v >= umod()) _v -= umod();
            return *this;
        }
        mint& operator*=(const mint& rhs) {
            _v = bt.mul(_v, rhs._v);
            return *this;
        }
        mint& operator/=(const mint& rhs) { return *this = *this * rhs.inv(); }
        
        mint operator+() const { return *this; }
        mint operator-() const { return mint() - *this; }
        
        mint pow(long long n) const {
            assert(0 <= n);
            mint x = *this, r = 1;
            while (n) {
                if (n & 1) r *= x;
                x *= x;
                n >>= 1;
            }
            return r;
        }
        mint inv() const {
            auto eg = internal::inv_gcd(_v, mod());
            assert(eg.first == 1);
            return eg.second;
        }
        
        friend mint operator+(const mint& lhs, const mint& rhs) {
            return mint(lhs) += rhs;
        }
        friend mint operator-(const mint& lhs, const mint& rhs) {
            return mint(lhs) -= rhs;
        }
        friend mint operator*(const mint& lhs, const mint& rhs) {
            return mint(lhs) *= rhs;
        }
        friend mint operator/(const mint& lhs, const mint& rhs) {
            return mint(lhs) /= rhs;
        }
        friend bool operator==(const mint& lhs, const mint& rhs) {
            return lhs._v == rhs._v;
        }
        friend bool operator!=(const mint& lhs, const mint& rhs) {
            return lhs._v != rhs._v;
        }
        
    private:
        unsigned int _v;
        static internal::barrett bt;
        static unsigned int umod() { return bt.umod(); }
    };
    template <int id> internal::barrett dynamic_modint<id>::bt = 998244353;
    
    using modint998244353 = static_modint<998244353>;
    using modint1000000007 = static_modint<1000000007>;
    using modint = dynamic_modint<-1>;
    
    namespace internal {
        
        template <class T>
        using is_static_modint = std::is_base_of<internal::static_modint_base, T>;
        
        template <class T>
        using is_static_modint_t = std::enable_if_t<is_static_modint<T>::value>;
        
        template <class> struct is_dynamic_modint : public std::false_type {};
        template <int id>
        struct is_dynamic_modint<dynamic_modint<id>> : public std::true_type {};
        
        template <class T>
        using is_dynamic_modint_t = std::enable_if_t<is_dynamic_modint<T>::value>;
        
    }  // namespace internal
    
}  // namespace atcoder

using mint=atcoder::modint998244353;

using mat=vector<vector<mint>>;

mint det(mat& A){
    int n=si(A);
    
    bool f=0;
    mint res=1;
    
    for(int i=0;i<n;i++){
        int pivot=i;
        for(int j=i;j<n;j++){
            if(A[j][i].val()) pivot=j;
        }
        if(i!=pivot){
            swap(A[i],A[pivot]);
            f^=1;
        }
        
        if(A[i][i]==0) return 0;
        res*=A[i][i];
        
        mint waru=A[i][i].inv();
        
        for(int j=i+1;j<n;j++){
            A[i][j]*=waru;
        }
        
        A[i][i]=1;
        
        for(int j=0;j<n;j++){
            if(i!=j&&A[j][i].val()){
                for(int k=0;k<n;k++){
                    if(k==i) continue;
                    A[j][k]-=A[j][i]*A[i][k];
                }
                A[j][i]=0;
            }
        }
    }
    
    if(f) res*=-1;
    
    return res;
}

int main() {
    
    std::ifstream in("text.txt");
    std::cin.rdbuf(in.rdbuf());
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    
    int N,M;cin>>N>>M;
    vector<pair<int,int>> E(M);
    for(int i=0;i<M;i++){
        int a,b;cin>>a>>b;a--;b--;
        if(a>b) swap(a,b);
        E[i]=mp(a,b);
    }
    
    for(int q=0;q<30;q++){
        mat A(N,vector<mint>(N));
        for(int i=0;i<M;i++){
            auto [a,b]=E[i];
            if(a==0){
                A[a][b]=rng();
                A[b][a]=rng();
            }else{
                A[a][b]=rng();
                A[b][a]=mod-A[a][b];
            }
        }
        
        mint d=det(A);
        
        if(d.val()){
            cout<<"Yes\n";
            return 0;
        }
    }
    
    cout<<"No\n";
}
accuracy: 1
time_ms: 160
memory_kb: 3616
final_rank: 3

code_snippet: #ifndef HIDDEN_IN_VS // 折りたたみ用

// 警告の抑制
#define _CRT_SECURE_NO_WARNINGS

// ライブラリの読み込み
#include <bits/stdc++.h>
using namespace std;

// 型名の短縮
using ll = long long; // -2^63 ～ 2^63 = 9 * 10^18（int は -2^31 ～ 2^31 = 2 * 10^9）
using pii = pair<int, int>;	using pll = pair<ll, ll>;	using pil = pair<int, ll>;	using pli = pair<ll, int>;
using vi = vector<int>;		using vvi = vector<vi>;		using vvvi = vector<vvi>;
using vl = vector<ll>;		using vvl = vector<vl>;		using vvvl = vector<vvl>;
using vb = vector<bool>;	using vvb = vector<vb>;		using vvvb = vector<vvb>;
using vc = vector<char>;	using vvc = vector<vc>;		using vvvc = vector<vvc>;
using vd = vector<double>;	using vvd = vector<vd>;		using vvvd = vector<vvd>;
template <class T> using priority_queue_rev = priority_queue<T, vector<T>, greater<T>>;
using Graph = vvi;

// 定数の定義
const double PI = acos(-1);
const vi DX = { 1, 0, -1, 0 }; // 4 近傍（下，右，上，左）
const vi DY = { 0, 1, 0, -1 };
int INF = 1001001001; ll INFL = 4004004004004004004LL;
double EPS = 1e-12;

// 入出力高速化
struct fast_io { fast_io() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(18); } } fastIOtmp;

// 汎用マクロの定義
#define all(a) (a).begin(), (a).end()
#define sz(x) ((int)(x).size())
#define lbpos(a, x) (int)distance((a).begin(), std::lower_bound(all(a), x))
#define ubpos(a, x) (int)distance((a).begin(), std::upper_bound(all(a), x))
#define Yes(b) {cout << ((b) ? "Yes\n" : "No\n");}
#define rep(i, n) for(int i = 0, i##_len = int(n); i < i##_len; ++i) // 0 から n-1 まで昇順
#define repi(i, s, t) for(int i = int(s), i##_end = int(t); i <= i##_end; ++i) // s から t まで昇順
#define repir(i, s, t) for(int i = int(s), i##_end = int(t); i >= i##_end; --i) // s から t まで降順
#define repe(v, a) for(const auto& v : (a)) // a の全要素（変更不可能）
#define repea(v, a) for(auto& v : (a)) // a の全要素（変更可能）
#define repb(set, d) for(int set = 0; set < (1 << int(d)); ++set) // d ビット全探索（昇順）
#define repp(a) sort(all(a)); for(bool a##_perm = true; a##_perm; a##_perm = next_permutation(all(a))) // a の順列全て（昇順）
#define smod(n, m) ((((n) % (m)) + (m)) % (m)) // 非負mod
#define uniq(a) {sort(all(a)); (a).erase(unique(all(a)), (a).end());} // 重複除去
#define EXIT(a) {cout << (a) << endl; exit(0);} // 強制終了

// 汎用関数の定義
template <class T> inline ll pow(T n, int k) { ll v = 1; rep(i, k) v *= n; return v; }
template <class T> inline bool chmax(T& M, const T& x) { if (M < x) { M = x; return true; } return false; } // 最大値を更新（更新されたら true を返す）
template <class T> inline bool chmin(T& m, const T& x) { if (m > x) { m = x; return true; } return false; } // 最小値を更新（更新されたら true を返す）

// 演算子オーバーロード
template <class T, class U> inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template <class T> inline istream& operator>>(istream& is, vector<T>& v) { repea(x, v) is >> x; return is; }
template <class T> inline vector<T>& operator--(vector<T>& v) { repea(x, v) --x; return v; }
template <class T> inline vector<T>& operator++(vector<T>& v) { repea(x, v) ++x; return v; }

// 手元環境（Visual Studio）
#ifdef _MSC_VER
#include "local.hpp"
// 提出用（gcc）
#else
inline int popcount(int n) { return __builtin_popcount(n); }
inline int popcount(ll n) { return __builtin_popcountll(n); }
inline int lsb(int n) { return n != 0 ? __builtin_ctz(n) : -1; }
inline int lsb(ll n) { return n != 0 ? __builtin_ctzll(n) : -1; }
inline int msb(int n) { return n != 0 ? (31 - __builtin_clz(n)) : -1; }
inline int msb(ll n) { return n != 0 ? (63 - __builtin_clzll(n)) : -1; }
#define gcd __gcd
#define dump(...)
#define dumpel(v)
#define dump_list(v)
#define input_from_file(f)
#define output_to_file(f)
#define Assert(b) { if (!(b)) while (1) cout << "OLE"; }
#endif

#endif // 折りたたみ用


////--------------AtCoder 専用--------------
//#include <atcoder/all>
//using namespace atcoder;
//
//using mint = modint1000000007;
////using mint = modint998244353;
////using mint = modint; // mint::set_mod(m);
//
//istream& operator>>(istream& is, mint& x) { ll x_; is >> x_; x = x_; return is; }
//ostream& operator<<(ostream& os, const mint& x) { os << x.val(); return os; }
//using vm = vector<mint>; using vvm = vector<vm>; using vvvm = vector<vvm>;
////----------------------------------------


#ifndef ATCODER_INTERNAL_MATH_HPP
#define ATCODER_INTERNAL_MATH_HPP 1

#include <utility>

#ifdef _MSC_VER
#include <intrin.h>
#endif

namespace atcoder {

    namespace internal {

        // @param m `1 <= m`
        // @return x mod m
        constexpr long long safe_mod(long long x, long long m) {
            x %= m;
            if (x < 0) x += m;
            return x;
        }

        // Fast modular multiplication by barrett reduction
        // Reference: https://en.wikipedia.org/wiki/Barrett_reduction
        // NOTE: reconsider after Ice Lake
        struct barrett {
            unsigned int _m;
            unsigned long long im;

            // @param m `1 <= m < 2^31`
            explicit barrett(unsigned int m) : _m(m), im((unsigned long long)(-1) / m + 1) {}

            // @return m
            unsigned int umod() const { return _m; }

            // @param a `0 <= a < m`
            // @param b `0 <= b < m`
            // @return `a * b % m`
            unsigned int mul(unsigned int a, unsigned int b) const {
                // [1] m = 1
                // a = b = im = 0, so okay

                // [2] m >= 2
                // im = ceil(2^64 / m)
                // -> im * m = 2^64 + r (0 <= r < m)
                // let z = a*b = c*m + d (0 <= c, d < m)
                // a*b * im = (c*m + d) * im = c*(im*m) + d*im = c*2^64 + c*r + d*im
                // c*r + d*im < m * m + m * im < m * m + 2^64 + m <= 2^64 + m * (m + 1) < 2^64 * 2
                // ((ab * im) >> 64) == c or c + 1
                unsigned long long z = a;
                z *= b;
#ifdef _MSC_VER
                unsigned long long x;
                _umul128(z, im, &x);
#else
                unsigned long long x =
                    (unsigned long long)(((unsigned __int128)(z)*im) >> 64);
#endif
                unsigned int v = (unsigned int)(z - x * _m);
                if (_m <= v) v += _m;
                return v;
            }
        };

        // @param n `0 <= n`
        // @param m `1 <= m`
        // @return `(x ** n) % m`
        constexpr long long pow_mod_constexpr(long long x, long long n, int m) {
            if (m == 1) return 0;
            unsigned int _m = (unsigned int)(m);
            unsigned long long r = 1;
            unsigned long long y = safe_mod(x, m);
            while (n) {
                if (n & 1) r = (r * y) % _m;
                y = (y * y) % _m;
                n >>= 1;
            }
            return r;
        }

        // Reference:
        // M. Forisek and J. Jancina,
        // Fast Primality Testing for Integers That Fit into a Machine Word
        // @param n `0 <= n`
        constexpr bool is_prime_constexpr(int n) {
            if (n <= 1) return false;
            if (n == 2 || n == 7 || n == 61) return true;
            if (n % 2 == 0) return false;
            long long d = n - 1;
            while (d % 2 == 0) d /= 2;
            constexpr long long bases[3] = { 2, 7, 61 };
            for (long long a : bases) {
                long long t = d;
                long long y = pow_mod_constexpr(a, t, n);
                while (t != n - 1 && y != 1 && y != n - 1) {
                    y = y * y % n;
                    t <<= 1;
                }
                if (y != n - 1 && t % 2 == 0) {
                    return false;
                }
            }
            return true;
        }
        template <int n> constexpr bool is_prime = is_prime_constexpr(n);

        // @param b `1 <= b`
        // @return pair(g, x) s.t. g = gcd(a, b), xa = g (mod b), 0 <= x < b/g
        constexpr std::pair<long long, long long> inv_gcd(long long a, long long b) {
            a = safe_mod(a, b);
            if (a == 0) return { b, 0 };

            // Contracts:
            // [1] s - m0 * a = 0 (mod b)
            // [2] t - m1 * a = 0 (mod b)
            // [3] s * |m1| + t * |m0| <= b
            long long s = b, t = a;
            long long m0 = 0, m1 = 1;

            while (t) {
                long long u = s / t;
                s -= t * u;
                m0 -= m1 * u;  // |m1 * u| <= |m1| * s <= b

                // [3]:
                // (s - t * u) * |m1| + t * |m0 - m1 * u|
                // <= s * |m1| - t * u * |m1| + t * (|m0| + |m1| * u)
                // = s * |m1| + t * |m0| <= b

                auto tmp = s;
                s = t;
                t = tmp;
                tmp = m0;
                m0 = m1;
                m1 = tmp;
            }
            // by [3]: |m0| <= b/g
            // by g != b: |m0| < b/g
            if (m0 < 0) m0 += b / s;
            return { s, m0 };
        }

    }  // namespace internal

}  // namespace atcoder

#endif  // ATCODER_INTERNAL_MATH_HPP


#ifndef ATCODER_INTERNAL_TYPE_TRAITS_HPP
#define ATCODER_INTERNAL_TYPE_TRAITS_HPP 1

#include <cassert>
#include <numeric>
#include <type_traits>

namespace atcoder {

    namespace internal {

#ifndef _MSC_VER
        template <class T>
        using is_signed_int128 =
            typename std::conditional<std::is_same<T, __int128_t>::value ||
            std::is_same<T, __int128>::value,
            std::true_type,
            std::false_type>::type;

        template <class T>
        using is_unsigned_int128 =
            typename std::conditional<std::is_same<T, __uint128_t>::value ||
            std::is_same<T, unsigned __int128>::value,
            std::true_type,
            std::false_type>::type;

        template <class T>
        using make_unsigned_int128 =
            typename std::conditional<std::is_same<T, __int128_t>::value,
            __uint128_t,
            unsigned __int128>;

        template <class T>
        using is_integral = typename std::conditional<std::is_integral<T>::value ||
            is_signed_int128<T>::value ||
            is_unsigned_int128<T>::value,
            std::true_type,
            std::false_type>::type;

        template <class T>
        using is_signed_int = typename std::conditional<(is_integral<T>::value&&
            std::is_signed<T>::value) ||
            is_signed_int128<T>::value,
            std::true_type,
            std::false_type>::type;

        template <class T>
        using is_unsigned_int =
            typename std::conditional<(is_integral<T>::value&&
                std::is_unsigned<T>::value) ||
            is_unsigned_int128<T>::value,
            std::true_type,
            std::false_type>::type;

        template <class T>
        using to_unsigned = typename std::conditional<
            is_signed_int128<T>::value,
            make_unsigned_int128<T>,
            typename std::conditional<std::is_signed<T>::value,
            std::make_unsigned<T>,
            std::common_type<T>>::type>::type;

#else

        template <class T> using is_integral = typename std::is_integral<T>;

        template <class T>
        using is_signed_int =
            typename std::conditional<is_integral<T>::value&& std::is_signed<T>::value,
            std::true_type,
            std::false_type>::type;

        template <class T>
        using is_unsigned_int =
            typename std::conditional<is_integral<T>::value&&
            std::is_unsigned<T>::value,
            std::true_type,
            std::false_type>::type;

        template <class T>
        using to_unsigned = typename std::conditional<is_signed_int<T>::value,
            std::make_unsigned<T>,
            std::common_type<T>>::type;

#endif

        template <class T>
        using is_signed_int_t = std::enable_if_t<is_signed_int<T>::value>;

        template <class T>
        using is_unsigned_int_t = std::enable_if_t<is_unsigned_int<T>::value>;

        template <class T> using to_unsigned_t = typename to_unsigned<T>::type;

    }  // namespace internal

}  // namespace atcoder

#endif  // ATCODER_INTERNAL_TYPE_TRAITS_HPP


#ifndef ATCODER_MODINT_HPP
#define ATCODER_MODINT_HPP 1

#include <cassert>
#include <numeric>
#include <type_traits>

#ifdef _MSC_VER
#include <intrin.h>
#endif


namespace atcoder {

    namespace internal {

        struct modint_base {};
        struct static_modint_base : modint_base {};

        template <class T> using is_modint = std::is_base_of<modint_base, T>;
        template <class T> using is_modint_t = std::enable_if_t<is_modint<T>::value>;

    }  // namespace internal

    template <int m, std::enable_if_t<(1 <= m)>* = nullptr>
    struct static_modint : internal::static_modint_base {
        using mint = static_modint;

    public:
        static constexpr int mod() { return m; }
        static mint raw(int v) {
            mint x;
            x._v = v;
            return x;
        }

        static_modint() : _v(0) {}
        template <class T, internal::is_signed_int_t<T>* = nullptr>
        static_modint(T v) {
            long long x = (long long)(v % (long long)(umod()));
            if (x < 0) x += umod();
            _v = (unsigned int)(x);
        }
        template <class T, internal::is_unsigned_int_t<T>* = nullptr>
        static_modint(T v) {
            _v = (unsigned int)(v % umod());
        }

        unsigned int val() const { return _v; }

        mint& operator++() {
            _v++;
            if (_v == umod()) _v = 0;
            return *this;
        }
        mint& operator--() {
            if (_v == 0) _v = umod();
            _v--;
            return *this;
        }
        mint operator++(int) {
            mint result = *this;
            ++* this;
            return result;
        }
        mint operator--(int) {
            mint result = *this;
            --* this;
            return result;
        }

        mint& operator+=(const mint& rhs) {
            _v += rhs._v;
            if (_v >= umod()) _v -= umod();
            return *this;
        }
        mint& operator-=(const mint& rhs) {
            _v -= rhs._v;
            if (_v >= umod()) _v += umod();
            return *this;
        }
        mint& operator*=(const mint& rhs) {
            unsigned long long z = _v;
            z *= rhs._v;
            _v = (unsigned int)(z % umod());
            return *this;
        }
        mint& operator/=(const mint& rhs) { return *this = *this * rhs.inv(); }

        mint operator+() const { return *this; }
        mint operator-() const { return mint() - *this; }

        mint pow(long long n) const {
            assert(0 <= n);
            mint x = *this, r = 1;
            while (n) {
                if (n & 1) r *= x;
                x *= x;
                n >>= 1;
            }
            return r;
        }
        mint inv() const {
            if (prime) {
                assert(_v);
                return pow(umod() - 2);
            }
            else {
                auto eg = internal::inv_gcd(_v, m);
                assert(eg.first == 1);
                return eg.second;
            }
        }

        friend mint operator+(const mint& lhs, const mint& rhs) {
            return mint(lhs) += rhs;
        }
        friend mint operator-(const mint& lhs, const mint& rhs) {
            return mint(lhs) -= rhs;
        }
        friend mint operator*(const mint& lhs, const mint& rhs) {
            return mint(lhs) *= rhs;
        }
        friend mint operator/(const mint& lhs, const mint& rhs) {
            return mint(lhs) /= rhs;
        }
        friend bool operator==(const mint& lhs, const mint& rhs) {
            return lhs._v == rhs._v;
        }
        friend bool operator!=(const mint& lhs, const mint& rhs) {
            return lhs._v != rhs._v;
        }

    private:
        unsigned int _v;
        static constexpr unsigned int umod() { return m; }
        static constexpr bool prime = internal::is_prime<m>;
    };

    template <int id> struct dynamic_modint : internal::modint_base {
        using mint = dynamic_modint;

    public:
        static int mod() { return (int)(bt.umod()); }
        static void set_mod(int m) {
            assert(1 <= m);
            bt = internal::barrett(m);
        }
        static mint raw(int v) {
            mint x;
            x._v = v;
            return x;
        }

        dynamic_modint() : _v(0) {}
        template <class T, internal::is_signed_int_t<T>* = nullptr>
        dynamic_modint(T v) {
            long long x = (long long)(v % (long long)(mod()));
            if (x < 0) x += mod();
            _v = (unsigned int)(x);
        }
        template <class T, internal::is_unsigned_int_t<T>* = nullptr>
        dynamic_modint(T v) {
            _v = (unsigned int)(v % mod());
        }

        unsigned int val() const { return _v; }

        mint& operator++() {
            _v++;
            if (_v == umod()) _v = 0;
            return *this;
        }
        mint& operator--() {
            if (_v == 0) _v = umod();
            _v--;
            return *this;
        }
        mint operator++(int) {
            mint result = *this;
            ++* this;
            return result;
        }
        mint operator--(int) {
            mint result = *this;
            --* this;
            return result;
        }

        mint& operator+=(const mint& rhs) {
            _v += rhs._v;
            if (_v >= umod()) _v -= umod();
            return *this;
        }
        mint& operator-=(const mint& rhs) {
            _v += mod() - rhs._v;
            if (_v >= umod()) _v -= umod();
            return *this;
        }
        mint& operator*=(const mint& rhs) {
            _v = bt.mul(_v, rhs._v);
            return *this;
        }
        mint& operator/=(const mint& rhs) { return *this = *this * rhs.inv(); }

        mint operator+() const { return *this; }
        mint operator-() const { return mint() - *this; }

        mint pow(long long n) const {
            assert(0 <= n);
            mint x = *this, r = 1;
            while (n) {
                if (n & 1) r *= x;
                x *= x;
                n >>= 1;
            }
            return r;
        }
        mint inv() const {
            auto eg = internal::inv_gcd(_v, mod());
            assert(eg.first == 1);
            return eg.second;
        }

        friend mint operator+(const mint& lhs, const mint& rhs) {
            return mint(lhs) += rhs;
        }
        friend mint operator-(const mint& lhs, const mint& rhs) {
            return mint(lhs) -= rhs;
        }
        friend mint operator*(const mint& lhs, const mint& rhs) {
            return mint(lhs) *= rhs;
        }
        friend mint operator/(const mint& lhs, const mint& rhs) {
            return mint(lhs) /= rhs;
        }
        friend bool operator==(const mint& lhs, const mint& rhs) {
            return lhs._v == rhs._v;
        }
        friend bool operator!=(const mint& lhs, const mint& rhs) {
            return lhs._v != rhs._v;
        }

    private:
        unsigned int _v;
        static internal::barrett bt;
        static unsigned int umod() { return bt.umod(); }
    };
    template <int id> internal::barrett dynamic_modint<id>::bt(998244353);

    using modint998244353 = static_modint<998244353>;
    using modint1000000007 = static_modint<1000000007>;
    using modint = dynamic_modint<-1>;

    namespace internal {

        template <class T>
        using is_static_modint = std::is_base_of<internal::static_modint_base, T>;

        template <class T>
        using is_static_modint_t = std::enable_if_t<is_static_modint<T>::value>;

        template <class> struct is_dynamic_modint : public std::false_type {};
        template <int id>
        struct is_dynamic_modint<dynamic_modint<id>> : public std::true_type {};

        template <class T>
        using is_dynamic_modint_t = std::enable_if_t<is_dynamic_modint<T>::value>;

    }  // namespace internal

}  // namespace atcoder

#endif  // ATCODER_MODINT_HPP


using namespace atcoder;

using mint = modint1000000007;
//using mint = modint998244353;
//using mint = modint; // mint::set_mod(m);

istream& operator>>(istream& is, mint& x) { ll x_; is >> x_; x = x_; return is; }
ostream& operator<<(ostream& os, const mint& x) { os << x.val(); return os; }
using vm = vector<mint>; using vvm = vector<vm>; using vvvm = vector<vvm>;


//【グラフの入力】O(|V| + |E|)
/*
* 始点 終点の組からなる入力を受け取り，n 頂点 m 辺のグラフを構築する．
*
* n : グラフの頂点の数
* m : グラフの辺の数
* g : ここにグラフを構築して返す
* undirected : 無向グラフなら true
* one_indexed : 入力が 1-indexed で与えられるなら true
*/
void read_graph(int n, int m, Graph& g, bool undirected = true, bool one_indexed = true) {
	g = Graph(n);
	rep(i, m) {
		int a, b;
		cin >> a >> b;

		if (one_indexed) { a--; b--; }

		g[a].push_back(b);
		if (undirected) g[b].push_back(a);
	}
}


//【頂点の除去】O(|V| + |E|)
/*
* グラフ g から頂点の集合 v_el とそれに接続する辺を除去したグラフを g2 に格納し，頂点数を返す．
* また g2 の頂点 i が g のどの頂点と対応するかを prv[i] に格納する．
*/
int eliminate_vertex(const Graph& g, const vi& v_el, Graph& g2, vi* prv = nullptr) {
	int n = sz(g);
	if (prv != nullptr) prv->clear();

	// ids[v] : g の頂点 v が g2 の何番目の頂点になるか（消去されるなら -1）
	vi ids(n); int id = 0;
	repe(v, v_el) ids[v] = -1;
	
	rep(v, n) {
		if (ids[v] == -1) continue;

		ids[v] = id++;
		if (prv != nullptr) prv->emplace_back(v);
	}

	if (id == 0) {
		g2.clear();
		return 0;
	}

	g2 = Graph(id);

	rep(s, n) {
		if (ids[s] == -1) continue;

		repe(t, g[s]) {
			if (ids[t] == -1) continue;

			g2[ids[s]].emplace_back(ids[t]);
		}
	}

	return id;
}


//【行列】
/*
* 行列を表す構造体
*
* Matrix(m, n) : O(m n)
*	m * n 零行列で初期化する．
*
* Matrix(n) : O(n^2)
*	n * n 単位行列で初期化する．
*
* Matrix(a) : O(m n)
*	配列 a の要素で初期化する．
*
* A + B : O(m n)
*	m * n 行列 A, B の和を返す．+= も使用可．
*
* A - B : O(m n)
*	m * n 行列 A, B の差を返す．-= も使用可．
*
* c * A ／ A * c : O(m n)
*	m * n 行列 A とスカラー c のスカラー積を返す．*= も使用可．
*
* A * x : O(m n)
*	m * n 行列 A と n 次元列ベクトル x の積を返す．
*
* x * A : O(m n)
*	m 次元行ベクトル x と m * n 行列 A の積を返す．
*
* A * B : O(l m n)
*	l * m 行列 A と m * n 行列 B の積を返す．
*
* pow(d) : O(n^3 log d)
*	自身を d 乗した行列を返す．
*/
template <class T> struct Matrix {
	int m, n; // 行列のサイズ（m 行 n 列）
	vector<vector<T>> v; // 行列の成分

	// コンストラクタ（初期化なし，零行列，単位行列，二次元配列）
	Matrix() : m(0), n(0) {}
	Matrix(const int& m_, const int& n_) : m(m_), n(n_), v(m_, vector<T>(n_)) {}
	Matrix(const int& n_) : m(n_), n(n_), v(n_, vector<T>(n_)) { rep(i, n) v[i][i] = 1; }
	Matrix(const vector<vector<T>>& a) : m(sz(a)), n(sz(a[0])), v(a) {}

	// 代入
	Matrix(const Matrix& b) = default;
	Matrix& operator=(const Matrix& b) = default;

	// 入力
	friend istream& operator>>(istream& is, Matrix& a) {
		rep(i, a.m) rep(j, a.n) is >> a.v[i][j];
		return is;
	}

	// アクセス
	vector<T> const& operator[](int i) const { return v[i]; }
	vector<T>& operator[](int i) { return v[i]; }

	// 比較
	bool operator==(const Matrix& b) const { return m == b.m && n == b.n && v == b.v; }
	bool operator!=(const Matrix& b) const { return !(*this == b); }

	// 加算，減算，スカラー倍
	Matrix& operator+=(const Matrix& b) {
		rep(i, m) rep(j, n) v[i][j] += b.v[i][j];
		return *this;
	}
	Matrix& operator-=(const Matrix& b) {
		rep(i, m) rep(j, n) v[i][j] -= b.v[i][j];
		return *this;
	}
	Matrix& operator*=(const T& c) {
		rep(i, m) rep(j, n) v[i][j] *= c;
		return *this;
	}
	Matrix operator+(const Matrix& b) const { return Matrix(*this) += b; }
	Matrix operator-(const Matrix& b) const { return Matrix(*this) -= b; }
	Matrix operator*(const T& c) const { return Matrix(*this) *= c; }
	friend Matrix operator*(const T& c, const Matrix<T>& a) { return a * c; }
	Matrix operator-() const { return Matrix(*this) *= T(-1); }

	// 行列ベクトル積 : O(m n)
	vector<T> operator*(const vector<T>& x) const {
		vector<T> y(m);
		rep(i, m) rep(j, n)	y[i] += v[i][j] * x[j];
		return y;
	}

	// ベクトル行列積 : O(m n)
	friend vector<T> operator*(const vector<T>& x, const Matrix& a) {
		vector<T> y(a.n);
		rep(i, a.m) rep(j, a.n) y[j] += x[i] * a.v[i][j];
		return y;
	}

	// 積：O(n^3)
	Matrix operator*(const Matrix& b) const {
		// verify : https://judge.yosupo.jp/problem/matrix_product

		Matrix res(m, b.n);
		rep(i, res.m) rep(j, res.n) rep(k, n) res.v[i][j] += v[i][k] * b.v[k][j];
		return res;
	}
	Matrix& operator*=(const Matrix& b) { *this = *this * b; return *this; }

	// 累乗：O(n^3 log d)
	Matrix pow(ll d) const {
		Matrix res(n), pow2 = *this;
		while (d > 0) {
			if ((d & 1) != 0) res *= pow2;
			pow2 *= pow2;
			d /= 2;
		}
		return res;
	}

#ifdef _MSC_VER
	friend ostream& operator<<(ostream& os, const Matrix& a) {
		rep(i, a.m) {
			rep(j, a.n) os << a.v[i][j] << " ";
			os << endl;
		}
		return os;
	}

	// Mathematica の書式に合わせた出力
	void print() const {
		cerr << "{\n";
		rep(i, m) {
			cerr << "{";
			rep(j, n) cerr << v[i][j] << (j < n - 1 ? "," : "}");
			cerr << (i < m - 1 ? ",\n" : "\n");
		}
		cerr << "}\n";
	}
#endif
};


//【行列式】O(n^3)
/*
* n 次正方行列 mat の行列式を返す．
*/
template <class T> T determinant(Matrix<T>& mat) {
	// verify : https://judge.yosupo.jp/problem/matrix_det

	int n = mat.n;
	auto& v = mat.v;

	// 注目位置を (i, j)（i 行目かつ j 列目）とする．
	int i = 0, j = 0;

	// 行列式の値
	T res = 1;

	while (i < n && j < n) {
		// 同じ列の下方の行から非 0 成分を見つける．
		int k = i;
		while (k < n && v[k][j] == 0) k++;

		// 見つからなかったら零列ベクトルを含むので行列式は 0 である．
		if (k == n) return T(0);

		// 見つかったら i 行目とその行を入れ替える．
		// 行列式の値は -1 倍しておく．
		if (k != i) {
			swap(v[i], v[k]);
			res *= T(-1);
		}

		// v[i][j] が 1 になるよう行全体を v[i][j] で割る．
		// 行列式の値は v[i][j] 倍しておく．
		T div = v[i][j];
		repi(t, j, n - 1) v[i][t] /= div;
		res *= div;

		// v[i][j] より下方の行の成分が全て 0 になるよう i 行目を定数倍して減じる．
		// 行列式の値は変化しない．
		repi(k, i + 1, n - 1) {
			T mul = v[k][j];
			repi(t, j, n - 1) v[k][t] -= v[i][t] * mul;
		}

		// 注目位置を右下に移す．
		i++; j++;
	}

	return res;
}


int main() {
//	input_from_file("input.txt");
//	output_to_file("output.txt");
	
	int n, m;
	cin >> n >> m;

	Graph g;
	read_graph(n, m, g);

	auto start = chrono::system_clock::now();

	vi p(n, -1);
	vector<pii> es;

	vi dist(n, INF); // スタートからの最短距離を保持するテーブル : O(n)
	dist[0] = 0;

	queue<int> que; // 次に探索する頂点を入れておくキュー
	que.push(0);

	while (!que.empty()) {
		// 未探索の頂点を 1 つ得る．
		auto s = que.front(); que.pop();

		repe(t, g[s]) {
			if (dist[t] == dist[s] && s < t) {
				es.emplace_back(s, t);
				continue;
			}

			// 発見済みの頂点なら何もしない．
			if (dist[t] != INF) continue;

			// スタートからの最短距離を確定する．
			// 幅優先探索なので，最短だという保証がある．
			dist[t] = dist[s] + 1;
			p[t] = s;

			// 未探索の頂点として t を追加する．
			que.push(t);
		}
	}
	dump(dist); dump(p); dump(es);

	mt19937_64 mt((int)time(NULL));
	uniform_int_distribution<int> rnd(1, (int)1e9);

	shuffle(all(es), mt);

	repe(e, es) {
		int v1, v2;
		tie(v1, v2) = e;

		vi v_el{0};
		while (v1 != 0) {
			v_el.emplace_back(v1);
			v1 = p[v1];
		}
		while (v2 != 0) {
			v_el.emplace_back(v2);
			v2 = p[v2];
		}

		Graph g2;
		int n2 = eliminate_vertex(g, v_el, g2);
		dumpel(g2);

		Matrix<mint> mat(n2, n2);
		rep(s, n2) {
			repe(t, g2[s]) {
				if (s > t) continue;

				int x = rnd(mt);
				mat[s][t] = x;
				mat[t][s] = -x;
			}
		}

		mint det = determinant(mat);

		if (det != 0) EXIT("Yes");

		auto now = chrono::system_clock::now();
		auto msec = chrono::duration_cast<std::chrono::milliseconds>(now - start).count();
		if (msec >= 2800) break;
	}

	EXIT("No");
}
accuracy: 1
time_ms: 1480
memory_kb: 4212
final_rank: 12

code_snippet: #include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;




typedef vector<ll> V;
typedef vector<V> MATRIX;

int N;

ll gcd(ll x,ll y){

	x = abs(x);
	y = abs(y);

	if(x < y){
		swap(x,y);
	}
	if(y == 0){
		return x;
	}else{
		return gcd(y,x%y);
	}
}

ll lcm(ll x,ll y){

	return (x*y)/gcd(x,y);
}

ll extgcd(ll a,ll b,ll &x,ll &y){
	ll d = a;
	if(b != 0){
		d = extgcd(b,a%b,y,x);
		y -= (a/b)*x;
	}else{
		x = 1;
		y = 0;
	}
	return d;
}

ll mod_inverse(ll a,ll m){
    ll x,y;
    extgcd(a,m,x,y);
    return (m+x%m)%m;
}



ll determinant(MATRIX A){

	MATRIX C(N,V(N));

	for(int row = 0; row < N; row++){
		for(int col = 0; col < N; col++){
			C[row][col] = (A[row][col]+MOD)%MOD;
		}
	}

	ll mult = 1;

	for(int base = 0; base < N-1; base++){

		int row = -1;
		for(int i = base; i < N; i++){
			if(C[i][base] != 0){

				row = i;
				break;
			}
		}

		if(row == -1)return 0;

		if(row != base){

			swap(C[row],C[base]);
			mult *= (-1+MOD)%MOD;
			mult %= MOD;
		}

		for(int i= base+1; i < N; i++){

			ll tmp = C[i][base]*mod_inverse(C[base][base],MOD)%MOD;
			for(int k = base; k < N; k++){
				C[i][k] -= tmp*C[base][k]%MOD;
				if(C[i][k] < 0){
					C[i][k] = abs(C[i][k])%MOD;
					C[i][k] *= -1;
					C[i][k] += MOD;
				}
			}
		}
	}

	ll ret = 1;
	for(int i = 0; i < N; i++){

		ret *= C[i][i];
		ret %= MOD;
	}

	ret *= mod_inverse(mult,MOD);

	return ret%MOD;
}


int main(){

	int M;
	scanf("%d %d",&N,&M);

	MATRIX A(N,V(N));
	for(int row = 0; row < N; row++){
		for(int col = 0; col < N; col++){
			A[row][col] = 0;
		}
	}

	int from,to;

	for(int i = 0; i < M; i++){

		scanf("%d %d",&from,&to);
		from--;
		to--;

		if(from == 0 || to == 0){

			A[from][to] = rand();
			A[to][from] = rand();

		}else{

			A[from][to] = rand();
			A[to][from] = -A[from][to];
		}
	}

	if(determinant(A) != 0){

		printf("Yes\n");
	}else{

		printf("No\n");
	}

	return 0;
}
accuracy: 1
time_ms: 20
memory_kb: 3884
final_rank: 5

code_snippet: #include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;




typedef vector<ll> V;
typedef vector<V> MATRIX;

int N;

ll gcd(ll x,ll y){

	x = abs(x);
	y = abs(y);

	if(x < y){
		swap(x,y);
	}
	if(y == 0){
		return x;
	}else{
		return gcd(y,x%y);
	}
}

ll lcm(ll x,ll y){

	return (x*y)/gcd(x,y);
}

ll extgcd(ll a,ll b,ll &x,ll &y){
	ll d = a;
	if(b != 0){
		d = extgcd(b,a%b,y,x);
		y -= (a/b)*x;
	}else{
		x = 1;
		y = 0;
	}
	return d;
}

ll mod_inverse(ll a,ll m){
    ll x,y;
    extgcd(a,m,x,y);
    return (m+x%m)%m;
}



ll determinant(MATRIX A){

	MATRIX C(N,V(N));

	for(int row = 0; row < N; row++){
		for(int col = 0; col < N; col++){
			C[row][col] = (A[row][col]+MOD)%MOD;
		}
	}

	ll mult = 1;

	for(int base = 0; base < N-1; base++){

		int row = -1;
		for(int i = base; i < N; i++){
			if(C[i][base] != 0){

				row = i;
				break;
			}
		}

		if(row == -1)return 0;

		if(row != base){

			swap(C[row],C[base]);
			mult *= (-1+MOD)%MOD;
			mult %= MOD;
		}

		for(int i= base+1; i < N; i++){

			//if(C[i][base] == 0)continue;

			ll tmp = C[i][base]*mod_inverse(C[base][base],MOD)%MOD;
			for(int k = base; k < N; k++){
				C[i][k] -= tmp*C[base][k]%MOD;
				if(C[i][k] < 0){
					C[i][k] = abs(C[i][k])%MOD;
					C[i][k] *= -1;
					C[i][k] += MOD;
				}
			}
		}
	}

	ll ret = 1;
	for(int i = 0; i < N; i++){

		ret *= C[i][i];
		ret %= MOD;
	}

	ret *= mod_inverse(mult,MOD);

	return ret%MOD;
}


int main(){

	int M;
	scanf("%d %d",&N,&M);

	MATRIX A(N,V(N));
	for(int row = 0; row < N; row++){
		for(int col = 0; col < N; col++){
			A[row][col] = 0;
		}
	}

	int from,to;
	ll NUM = 10000;

	for(int i = 0; i < M; i++){

		scanf("%d %d",&from,&to);
		from--;
		to--;

		if(from == 0 || to == 0){

			A[from][to] = rand();
			A[to][from] = rand();

		}else{

			A[from][to] = rand();
			A[to][from] = -A[from][to];
		}
	}

	if(determinant(A) != 0){

		printf("Yes\n");
	}else{

		printf("No\n");
	}

	return 0;
}
accuracy: 1
time_ms: 20
memory_kb: 3872
final_rank: 4

code_snippet: #include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;




typedef vector<ll> V;
typedef vector<V> MATRIX;

int N;

ll gcd(ll x,ll y){

	x = abs(x);
	y = abs(y);

	if(x < y){
		swap(x,y);
	}
	if(y == 0){
		return x;
	}else{
		return gcd(y,x%y);
	}
}

ll lcm(ll x,ll y){

	return (x*y)/gcd(x,y);
}

ll extgcd(ll a,ll b,ll &x,ll &y){
	ll d = a;
	if(b != 0){
		d = extgcd(b,a%b,y,x);
		y -= (a/b)*x;
	}else{
		x = 1;
		y = 0;
	}
	return d;
}

ll mod_inverse(ll a,ll m){
    ll x,y;
    extgcd(a,m,x,y);
    return (m+x%m)%m;
}



ll determinant(MATRIX A){

	MATRIX C(N,V(N));

	for(int row = 0; row < N; row++){
		for(int col = 0; col < N; col++){
			C[row][col] = (A[row][col]+MOD)%MOD;
		}
	}

	ll mult = 1;

	for(int base = 0; base < N-1; base++){

		int row = -1;
		for(int i = base; i < N; i++){
			if(C[i][base] != 0){

				row = i;
				break;
			}
		}

		if(row == -1)return 0;

		if(row != base){

			swap(C[row],C[base]);
			mult *= (-1+MOD)%MOD;
			mult %= MOD;
		}

		for(int i= base+1; i < N; i++){

			if(C[i][base] == 0)continue;

			ll tmp = C[i][base]*mod_inverse(C[base][base],MOD)%MOD;
			for(int k = base; k < N; k++){
				C[i][k] -= tmp*C[base][k]%MOD;
				if(C[i][k] < 0){
					//C[i][k] = abs(C[i][k])%MOD;
					//C[i][k] *= -1;
					C[i][k] += MOD;
				}
			}
		}
	}

	ll ret = 1;
	for(int i = 0; i < N; i++){

		ret *= C[i][i];
		ret %= MOD;
	}

	ret *= mod_inverse(mult,MOD);

	return ret%MOD;
}


int main(){

	int M;
	scanf("%d %d",&N,&M);

	MATRIX A(N,V(N));
	for(int row = 0; row < N; row++){
		for(int col = 0; col < N; col++){
			A[row][col] = 0;
		}
	}

	int from,to;
	ll NUM = 10000;

	for(int i = 0; i < M; i++){

		scanf("%d %d",&from,&to);
		from--;
		to--;

		if(from == 0 || to == 0){

			A[from][to] = rand();
			A[to][from] = rand();

		}else{

			A[from][to] = rand();
			A[to][from] = -A[from][to];
		}
	}

	if(determinant(A) != 0){

		printf("Yes\n");
	}else{

		printf("No\n");
	}

	return 0;
}
accuracy: 0.625
time_ms: 20
memory_kb: 3920
final_rank: 14

code_snippet: #include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;




typedef vector<ll> V;
typedef vector<V> MATRIX;

int N;

ll gcd(ll x,ll y){

	x = abs(x);
	y = abs(y);

	if(x < y){
		swap(x,y);
	}
	if(y == 0){
		return x;
	}else{
		return gcd(y,x%y);
	}
}

ll lcm(ll x,ll y){

	return (x*y)/gcd(x,y);
}

ll extgcd(ll a,ll b,ll &x,ll &y){
	ll d = a;
	if(b != 0){
		d = extgcd(b,a%b,y,x);
		y -= (a/b)*x;
	}else{
		x = 1;
		y = 0;
	}
	return d;
}

ll mod_inverse(ll a,ll m){
    ll x,y;
    extgcd(a,m,x,y);
    return (m+x%m)%m;
}



ll determinant(MATRIX A){

	MATRIX C(N,V(N));

	for(int row = 0; row < N; row++){
		for(int col = 0; col < N; col++){
			C[row][col] = (A[row][col]+MOD)%MOD;
		}
	}

	ll mult = 1;

	for(int base = 0; base < N-1; base++){

		int row = -1;
		for(int i = base; i < N; i++){
			if(C[i][base] != 0){

				row = i;
				break;
			}
		}

		if(row == -1)return 0;

		if(row != base){

			swap(C[row],C[base]);
			mult *= (-1+MOD)%MOD;
			mult %= MOD;
		}

		for(int i= base+1; i < N; i++){

			if(C[i][base] == 0)continue;

			ll tmp = C[i][base]*mod_inverse(C[base][base],MOD)%MOD;
			for(int k = base; k < N; k++){
				C[i][k] -= tmp*C[base][k]%MOD;
				if(C[i][k] < 0){
					C[i][k] = abs(C[i][k])%MOD;
					C[i][k] *= -1;
					C[i][k] += MOD;
				}
			}
		}
	}

	ll ret = 1;
	for(int i = 0; i < N; i++){

		ret *= C[i][i];
		ret %= MOD;
	}

	ret *= mod_inverse(mult,MOD);

	return ret%MOD;
}


int main(){

	int M;
	scanf("%d %d",&N,&M);

	MATRIX A(N,V(N));
	for(int row = 0; row < N; row++){
		for(int col = 0; col < N; col++){
			A[row][col] = 0;
		}
	}

	int from,to;
	ll NUM = 10000;

	for(int i = 0; i < M; i++){

		scanf("%d %d",&from,&to);
		from--;
		to--;

		if(from == 0 || to == 0){

			A[from][to] = rand();
			A[to][from] = rand();

		}else{

			A[from][to] = rand();
			A[to][from] = -A[from][to];
		}
	}

	if(determinant(A) != 0){

		printf("Yes\n");
	}else{

		printf("No\n");
	}

	return 0;
}
accuracy: 0.625
time_ms: 20
memory_kb: 3896
final_rank: 13

code_snippet: #include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;




typedef vector<ll> V;
typedef vector<V> MATRIX;

int N;

ll gcd(ll x,ll y){

	x = abs(x);
	y = abs(y);

	if(x < y){
		swap(x,y);
	}
	if(y == 0){
		return x;
	}else{
		return gcd(y,x%y);
	}
}

ll lcm(ll x,ll y){

	return (x*y)/gcd(x,y);
}

ll extgcd(ll a,ll b,ll &x,ll &y){
	ll d = a;
	if(b != 0){
		d = extgcd(b,a%b,y,x);
		y -= (a/b)*x;
	}else{
		x = 1;
		y = 0;
	}
	return d;
}

ll mod_inverse(ll a,ll m){
    ll x,y;
    extgcd(a,m,x,y);
    return (m+x%m)%m;
}




ll determinant(MATRIX A){

	MATRIX C(N,V(N));

	for(int row = 0; row < N; row++){
		for(int col = 0; col < N; col++){
			C[row][col] = (A[row][col]+MOD)%MOD;
		}
	}

	ll mult = 1;

	for(int base = 0; base < N-1; base++){

		int row = -1;
		for(int i = base; i < N; i++){
			if(C[i][base] != 0){

				row = i;
				break;
			}
		}

		if(row == -1)return 0;

		if(row != base){

			swap(C[row],C[base]);
			mult *= (-1+MOD)%MOD;
			mult %= MOD;
		}

		for(int k = base+1; k < N; k++){

			ll tmp = C[k][base]*mod_inverse(C[base][base],MOD)%MOD;
			for(int p = base; p < N; p++){
				C[k][p] -= tmp*C[base][p]%MOD;
				if(C[k][p] < 0){

					C[k][p] += MOD;
				}
			}
		}
	}

	ll ret = 1;
	for(int i = 0; i < N; i++){

		ret *= C[i][i];
		ret %= MOD;
	}

	ret *= mod_inverse(mult,MOD);

	return ret%MOD;
}


int main(){

	int M;
	scanf("%d %d",&N,&M);

	MATRIX A(N,V(N));
	for(int row = 0; row < N; row++){
		for(int col = 0; col < N; col++){
			A[row][col] = 0;
		}
	}

	int from,to;
	ll NUM = 10000;

	for(int i = 0; i < M; i++){

		scanf("%d %d",&from,&to);
		from--;
		to--;

		if(from == 0 || to == 0){

			A[from][to] = rand();
			A[to][from] = rand();

		}else{

			A[from][to] = rand();
			A[to][from] = -A[from][to];
		}
	}

	if(determinant(A) != 0){

		printf("Yes\n");
	}else{

		printf("No\n");
	}

	return 0;
}
accuracy: 1
time_ms: 20
memory_kb: 3904
final_rank: 6

code_snippet: #include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



typedef vector<ll> V;
typedef vector<V> MATRIX;

int N;

ll gcd(ll x,ll y){

	x = abs(x);
	y = abs(y);

	if(x < y){
		swap(x,y);
	}
	if(y == 0){
		return x;
	}else{
		return gcd(y,x%y);
	}
}

ll lcm(ll x,ll y){

	return (x*y)/gcd(x,y);
}

ll extgcd(ll a,ll b,ll &x,ll &y){
	ll d = a;
	if(b != 0){
		d = extgcd(b,a%b,y,x);
		y -= (a/b)*x;
	}else{
		x = 1;
		y = 0;
	}
	return d;
}

ll mod_inverse(ll a,ll m){
    ll x,y;
    extgcd(a,m,x,y);
    return (m+x%m)%m;
}

ll determinant(MATRIX A){

	MATRIX C(N,V(N));

	for(int row = 0; row < N; row++){
		for(int col = 0; col < N; col++){
			C[row][col] = (A[row][col]+MOD)%MOD;
		}
	}

	ll mult = 1;

	for(int base = 0; base < N-1; base++){

		int row = -1;
		for(int i = base; i < N; i++){
			if(C[i][base] != 0){

				row = i;
				break;
			}
		}

		if(row == -1)return 0;

		if(row != base){

			swap(C[row],C[base]);
			mult *= (-1+MOD)%MOD;
			mult %= MOD;
		}

		for(int k = base+1; k < N; k++){

			if(C[k][base] == 0)continue;

			ll LCM = lcm(C[base][base],C[k][base]);

			ll mult_base = LCM/C[base][base];
			ll mult_k = LCM/C[k][base];

			mult *= mult_k;
			mult %= MOD;

			for(int col = base; col < N; col++){

				C[k][col] *= mult_k;
				C[k][col] %= MOD;
			}

			for(int col = base; col < N; col++){

				C[k][col] -= C[base][col]*mult_base;

				if(C[k][col] < 0){
					C[k][col] = abs(C[k][col])%MOD;
					C[k][col] *= -1;
					C[k][col] += MOD;
				}
			}
		}
	}

	ll ret = 1;
	for(int i = 0; i < N; i++){

		ret *= C[i][i];
		ret %= MOD;
	}

	ret *= mod_inverse(mult,MOD);

	return ret%MOD;
}


int main(){

	int M;
	scanf("%d %d",&N,&M);

	MATRIX A(N,V(N));
	for(int row = 0; row < N; row++){
		for(int col = 0; col < N; col++){
			A[row][col] = 0;
		}
	}

	int from,to;
	ll NUM = 10000;

	for(int i = 0; i < M; i++){

		scanf("%d %d",&from,&to);
		from--;
		to--;

		if(from == 0 || to == 0){

			A[from][to] = rand()*NUM+rand()%NUM+3;
			A[to][from] = rand()*NUM+rand()%NUM+4;

		}else{

			A[from][to] = rand()*NUM+rand()%NUM+5;
			A[to][from] = -A[from][to];
		}
	}

	if(determinant(A) != 0){

		printf("Yes\n");
	}else{

		printf("No\n");
	}

	return 0;
}
accuracy: 0.1
time_ms: 10
memory_kb: 3884
final_rank: 18

code_snippet: #include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



typedef vector<ll> V;
typedef vector<V> MATRIX;

int N;

ll gcd(ll x,ll y){

	x = abs(x);
	y = abs(y);

	if(x < y){
		swap(x,y);
	}
	if(y == 0){
		return x;
	}else{
		return gcd(y,x%y);
	}
}

ll lcm(ll x,ll y){

	return (x*y)/gcd(x,y);
}

ll extgcd(ll a,ll b,ll &x,ll &y){
	ll d = a;
	if(b != 0){
		d = extgcd(b,a%b,y,x);
		y -= (a/b)*x;
	}else{
		x = 1;
		y = 0;
	}
	return d;
}

ll mod_inverse(ll a,ll m){
    ll x,y;
    extgcd(a,m,x,y);
    return (m+x%m)%m;
}

ll determinant(MATRIX A){

	MATRIX C(N,V(N));

	for(int row = 0; row < N; row++){
		for(int col = 0; col < N; col++){
			C[row][col] = (A[row][col]+MOD)%MOD;
		}
	}

	ll mult = 1;

	for(int base = 0; base < N-1; base++){

		int row = -1;
		for(int i = base; i < N; i++){
			if(C[i][base] != 0){

				row = i;
				break;
			}
		}

		if(row == -1)return 0;

		if(row != base){

			swap(C[row],C[base]);
			mult *= (-1+MOD)%MOD;
			mult %= MOD;
		}

		for(int k = base+1; k < N; k++){

			if(C[k][base] == 0)continue;

			ll LCM = lcm(C[base][base],C[k][base]);

			ll mult_base = LCM/C[base][base];
			ll mult_k = LCM/C[k][base];

			mult *= mult_k;
			mult %= MOD;

			for(int col = base; col < N; col++){

				C[k][col] *= mult_k;
				C[k][col] %= MOD;
			}

			for(int col = base; col < N; col++){

				C[k][col] -= C[base][col]*mult_base;

				if(C[k][col] < 0){
					C[k][col] = abs(C[k][col])%MOD;
					C[k][col] *= -1;
					C[k][col] += MOD;
				}
			}
		}
	}

	ll ret = 1;
	for(int i = 0; i < N; i++){

		ret *= C[i][i];
		ret %= MOD;
	}

	ret *= mod_inverse(mult,MOD);

	return ret%MOD;
}


int main(){

	int M;
	scanf("%d %d",&N,&M);

	MATRIX A(N,V(N));
	for(int row = 0; row < N; row++){
		for(int col = 0; col < N; col++){
			A[row][col] = 0;
		}
	}

	int from,to;
	ll NUM = 10000;

	for(int i = 0; i < M; i++){

		scanf("%d %d",&from,&to);
		from--;
		to--;

		if(from == 0 || to == 0){

			A[from][to] = rand()*NUM+rand()%NUM+3;
			A[to][from] = rand()*NUM+rand()%NUM+3;

		}else{

			A[from][to] = rand()*NUM+rand()%NUM+3;
			A[to][from] = -A[from][to];
		}
	}

	if(determinant(A) != 0){

		printf("Yes\n");
	}else{

		printf("No\n");
	}

	return 0;
}
accuracy: 0.1
time_ms: 10
memory_kb: 3828
final_rank: 16

code_snippet: #include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



typedef vector<ll> V;
typedef vector<V> MATRIX;

int N;

ll gcd(ll x,ll y){

	x = abs(x);
	y = abs(y);

	if(x < y){
		swap(x,y);
	}
	if(y == 0){
		return x;
	}else{
		return gcd(y,x%y);
	}
}

ll lcm(ll x,ll y){

	return (x*y)/gcd(x,y);
}

ll extgcd(ll a,ll b,ll &x,ll &y){
	ll d = a;
	if(b != 0){
		d = extgcd(b,a%b,y,x);
		y -= (a/b)*x;
	}else{
		x = 1;
		y = 0;
	}
	return d;
}

ll mod_inverse(ll a,ll m){
    ll x,y;
    extgcd(a,m,x,y);
    return (m+x%m)%m;
}

ll determinant(MATRIX A){

	MATRIX C(N,V(N));

	for(int row = 0; row < N; row++){
		for(int col = 0; col < N; col++){
			C[row][col] = (A[row][col]+MOD)%MOD;
		}
	}

	ll mult = 1;

	for(int base = 0; base < N-1; base++){

		int row = -1;
		for(int i = base; i < N; i++){
			if(C[i][base] != 0){

				row = i;
				break;
			}
		}

		if(row == -1)return 0;

		if(row != base){

			swap(C[row],C[base]);
			mult *= (-1+MOD)%MOD;
			mult %= MOD;
		}

		for(int k = base+1; k < N; k++){

			if(C[k][base] == 0)continue;

			ll LCM = lcm(C[base][base],C[k][base]);

			ll mult_base = LCM/C[base][base];
			ll mult_k = LCM/C[k][base];

			mult *= mult_k;
			mult %= MOD;

			for(int col = base; col < N; col++){

				C[k][col] *= mult_k;
				C[k][col] %= MOD;
			}

			for(int col = base; col < N; col++){

				C[k][col] -= C[base][col]*mult_base;

				if(C[k][col] < 0){
					C[k][col] = abs(C[k][col])%MOD;
					C[k][col] *= -1;
					C[k][col] += MOD;
				}
			}
		}
	}

	ll ret = 1;
	for(int i = 0; i < N; i++){

		ret *= C[i][i];
		ret %= MOD;
	}

	ret *= mod_inverse(mult,MOD);

	return ret%MOD;
}


int main(){

	int M;
	scanf("%d %d",&N,&M);

	MATRIX A(N,V(N));
	for(int row = 0; row < N; row++){
		for(int col = 0; col < N; col++){
			A[row][col] = 0;
		}
	}

	int from,to;
	for(int i = 0; i < M; i++){

		scanf("%d %d",&from,&to);
		from--;
		to--;

		if(from == 0 || to == 0){

			A[from][to] = rand();
			A[to][from] = rand();

		}else{

			A[from][to] = rand();
			A[to][from] = -A[from][to];
		}
	}

	if(determinant(A) != 0){

		printf("Yes\n");
	}else{

		printf("No\n");
	}

	return 0;
}
accuracy: 0.1
time_ms: 10
memory_kb: 3860
final_rank: 17

code_snippet: #include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto& (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define sar(a,n) cout<<#a<<":";rep(pachico,n)cout<<" "<<a[pachico];cout<<endl

using namespace std;

template<typename S,typename T>auto&operator<<(ostream&o,pair<S,T>p){return o<<"{"<<p.fi<<","<<p.se<<"}";}
template<typename T>auto&operator<<(ostream&o,set<T>s){for(auto&e:s)o<<e<<" ";return o;}
template<typename S,typename T,typename U>
auto&operator<<(ostream&o,priority_queue<S,T,U>q){while(!q.empty())o<<q.top()<<" ",q.pop();return o;}
template<typename K,typename T>auto&operator<<(ostream&o,map<K,T>m){for(auto&e:m)o<<e<<" ";return o;}
template<typename T>auto&operator<<(ostream&o,vector<T>v){for(auto&e:v)o<<e<<" ";return o;}
void ashow(){cout<<endl;}template<typename T,typename...A>void ashow(T t,A...a){cout<<t<<" ";ashow(a...);}

typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<P> vp;
typedef vector<double> vd;
typedef vector<string> vs;

const int MAX_N = 100005;

template <uint mod>
class ModInt {
private:
    uint v;
    static uint norm(const uint& x){ return x < mod ? x : x - mod; }
    static ModInt make(const uint& x){ ModInt m; return m.v = x, m; }
    static ModInt inv(const ModInt& x){ return make(inverse(x.v, mod)); }
    static uint inverse(int a, int m){
        int u[] = {a, 1, 0}, v[] = {m, 0, 1}, t;
        while(*v){
            t = *u / *v;
            swap(u[0] -= t * v[0], v[0]), swap(u[1] -= t * v[1], v[1]), swap(u[2] -= t * v[2], v[2]);
        }
        return (u[1] % m + m) % m;
    }

public:
    ModInt() : v{0}{}
    ModInt(const long long val) : v{norm(val % mod + mod)} {}
    ModInt(const ModInt<mod>& n) : v{n()} {}
	explicit operator bool() const noexcept { return v != 0; }
    bool operator!() const noexcept { return !static_cast<bool>(*this); }
    ModInt& operator=(const ModInt& n){ return v = n(), (*this); }
    ModInt& operator=(const long long val){ return v = norm(val % mod + mod), (*this); }
    ModInt operator+() const { return *this; }
    ModInt operator-() const { return v == 0 ? 0 : mod - v; }
    ModInt operator+(const ModInt& val) const { return make(norm(v + val())); }
    ModInt operator-(const ModInt& val) const { return make(norm(v + mod - val())); }
    ModInt operator*(const ModInt& val) const { return make((long long)v * val() % mod); }
    ModInt operator/(const ModInt& val) const { return *this * inv(val); }
    ModInt& operator+=(const ModInt& val){ return *this = *this + val; }
    ModInt& operator-=(const ModInt& val){ return *this = *this - val; }
    ModInt& operator*=(const ModInt& val){ return *this = *this * val; }
    ModInt& operator/=(const ModInt& val){ return *this = *this / val; }
    ModInt operator+(const long long val) const { return ModInt{v + val}; }
    ModInt operator-(const long long val) const { return ModInt{v - val}; }
    ModInt operator*(const long long val) const { return ModInt{(long long)v * (val % mod)}; }
    ModInt operator/(const long long val) const { return ModInt{(long long)v * inv(val)}; }
    ModInt& operator+=(const long long val){ return *this = *this + val; }
    ModInt& operator-=(const long long val){ return *this = *this - val; }
    ModInt& operator*=(const long long val){ return *this = *this * val; }
    ModInt& operator/=(const long long val){ return *this = *this / val; }
    bool operator==(const ModInt& val) const { return v == val.v; }
    bool operator!=(const ModInt& val) const { return !(*this == val); }
    bool operator==(const long long val) const { return v == norm(val % mod + mod); }
    bool operator!=(const long long val) const { return !(*this == val); }
    uint operator()() const { return v; }
    friend ModInt operator+(const long long val, const ModInt& n) { return n + val; }
    friend ModInt operator-(const long long val, const ModInt& n) { return ModInt{val - n()}; }
    friend ModInt operator*(const long long val, const ModInt& n) { return n * val; }
    friend ModInt operator/(const long long val, const ModInt& n) { return ModInt{val} / n; }
    friend bool operator==(const long long val, const ModInt& n) { return n == val; }
    friend bool operator!=(const long long val, const ModInt& n) { return !(val == n); }
    friend istream& operator>>(istream& is, ModInt& n){
        uint v;
        return is >> v, n = v, is;
    }
    friend ostream& operator<<(ostream& os, const ModInt& n){ return (os << n()); }
    friend ModInt power(ModInt x, long long n){
        ModInt ans = 1;
        while(n){
            if(n & 1) ans *= x;
            x *= x, n >>= 1;
        }
        return ans;
    }
};

template<typename T> class mat : public vector<vector<T> > {
private:
    int r, c;    //行,列
public:
    inline int row() const { return r; }
    inline int column() const { return c; }
    mat(const int n) : mat(n, n, 0){}
    mat(const int n, const int m, T val = 0)
        : vector<vector<T> >(n, vector<T>(m, val)), r{n}, c{m}{}
    mat operator+(const mat& another) const {
        mat<T> X(r, c);
        for(int i = 0; i < r; i++){
            for(int j = 0; j < c; j++){
                X[i][j] = (*this)[i][j] + another[i][j];
            }
        }
        return X;
    }
    mat operator-(const mat& another) const {
        mat<T> X(r,c);
        for(int i = 0; i < r; i++){
            for(int j = 0; j < c; j++){
                X[i][j] = (*this)[i][j] - another[i][j];
            }
        }
        return X;
    }
    mat operator*(const mat& another) const {
        mat<T> X(r, another.c);
        for(int i = 0; i < r; i++){
            for(int k = 0; k < c; k++){
                if(!(*this)[i][k]) continue;
                for(int j = 0; j < (another.c); j++){
                    X[i][j] += (*this)[i][k] * another[k][j];
                }
            }
        }
        return X;
    }
    int rank(){
        mat<T> X(r, c);
        for(int i = 0; i < r; i++){
            for(int j = 0; j < c; j++){
                X[i][j] = (*this)[i][j];
            }
        }
        int res = 0;
        for(int i = 0; i < c; i++){
            if(res == r) return res;
            if(!X[res][i]){
                int pivot = res + 1;
                for(; pivot < r; pivot++){
                    if(X[pivot][i]){
                        swap(X[res], X[pivot]);
                        break;
                    }
                }
                if(pivot == r) continue;
            }
            const T p = (T)1 / X[res][i];
            for(int j = i + 1; j < c; j++){ X[res][j] *= p; }
            for(int j = res + 1; j < r; j++){
                if(!X[j][i]) continue;
                for(int k = i + 1; k < c; k++){
                    X[j][k] -= X[res][k] * X[j][i];
                }
            }
            res++;
        }
        return res;
    }
    bool det_zero() const {
        mat<T> X(r);
        for(int i = 0; i < r; i++){
            for(int j = 0; j < c; j++){
                X[i][j] = (*this)[i][j];
            }
        }
        for(int i = 0; i < c; i++){
            if(!X[i][i]){
                int pivot = i + 1;
                for(; pivot < r; pivot++){
                    if(X[pivot][i]){
                        swap(X[i], X[pivot]);
                        break;
                    }
                }
                if(pivot == r) return true;
            }
            const T p = (T)1 / X[i][i];
            for(int j = i + 1; j < c; j++){ X[i][j] *= p; }
            for(int j = i + 1; j < r; j++){
                if(!X[j][i]) continue;
                for(int k = i + 1; k < c; k++){
                    X[j][k] -= X[i][k] * X[j][i];
                }
            }
        }
        return false;
    }
    mat inverse() const {
        mat X(r, 2*r);
        for(int i = 0; i < r; i++){
            for(int j = 0; j < r; j++){
                X[i][j] = (*this)[i][j];
            }
        }
        for(int i = 0; i < r; i++){
            X[i][r+i] = 1;
        }
        for(int i = 0; i < r; i++){
            if(!X[i][i]){
                int pivot = i + 1;
                for(; pivot < r; pivot++){
                    if(X[pivot][i]){
                        swap(X[i],X[pivot]);
                        break;
                    }
                }
                assert(pivot < r);
            }
            const T p = (T)1 / X[i][i];
            for(int j = i + 1; j < 2*r; j++){ X[i][j] *= p; }
            for(int j = 0; j < r; j++){
                if(i == j || !X[j][i]) continue;
                for(int k = i + 1; k < 2*r; k++){
                    X[j][k] -= X[i][k] * X[j][i];
                }
            }
        }
        mat res(r, r);
        for(int i = 0; i < r; i++){
            for(int j = 0; j < r; j++){
                res[i][j] = X[i][r+j];
            }
        }
        return res;
    }
};

class Matching {
private:
    int V;
    vector<pair<int, int> > es;
    vector<int> cnt;
    random_device rnd;
    mt19937 mt;
    uniform_int_distribution<> randval;
    static constexpr int LOOP = 2;
    static constexpr uint mod = 1000000007;
    mat<ModInt<mod> > inverse_22(const int id, const mat<ModInt<mod> >& invT){
        ModInt<mod> invdev = (ModInt<mod>)1 / (invT[0][0]*invT[id][id] - invT[0][id]*invT[id][0]);
        mat<ModInt<mod> > invN_3n_3n(2, 2);
        invN_3n_3n[0][0] = invT[id][id] * invdev, invN_3n_3n[0][1] = -invT[0][id] * invdev;
        invN_3n_3n[1][0] = -invT[id][0] * invdev, invN_3n_3n[1][1] = invT[0][0] * invdev;
        return invN_3n_3n;
    }
    void schur_complement(const int id, mat<ModInt<mod> >& invT){
        int sz = invT.row(), x = 0;
        mat<ModInt<mod> >N_12_12(sz-2), N_12_3n(sz-2, 2), N_3n_12(2, sz-2);
        for(int i = 1; i < sz; i++){
            if(i == id) continue;
            int y = 0;
            for(int j = 1; j < sz; j++){
                if(j == id) continue;
                N_12_12[x][y] = invT[i][j];
                N_3n_12[0][y] = invT[0][j], N_3n_12[1][y++] = invT[id][j];
            }
            N_12_3n[x][0] = invT[i][0], N_12_3n[x++][1] = invT[i][id];
        }
        invT = N_12_12 - N_12_3n * inverse_22(id, invT) * N_3n_12;
    }
    vector<pair<int, int> > find_matching(const mat<ModInt<mod> >& T){
        int sz = T.row();
        vector<pair<int, int> > res;
        mat<ModInt<mod> > invT = T.inverse();
        vector<int> vset(sz); iota(vset.begin(), vset.end(), 0);
        for(int i = sz; i > 0; i -= 2){
            for(int j = 1; j < i; j++){
                if(invT[0][j] && T[vset[0]][vset[j]]){
                    if(vset[j] < V) res.emplace_back(vset[0], vset[j]);
                    vset.erase(vset.begin()), vset.erase(vset.begin() + j - 1);
                    schur_complement(j, invT);
                    break;
                }
            }
        }
        return res;
    }

public:
    Matching(int node_size) : V(node_size), cnt(V+1, 0), mt(rnd()), randval(0, mod-1){}
    void add_edge(int u, int v){
        es.push_back(make_pair(u, v));
    }
    bool perfect_matchching(){
        for(int i = 0; i < LOOP; i++){
            mat<ModInt<mod> > A(V);
            for(auto e : es){
                int r = randval(mt);
                A[e.first][e.second] = r, A[e.second][e.first] = -r;
            }
            if(!A.det_zero()) return true;
        }
        return false;
    }
    int maximum_matchching(){
        for(int i = 0; i < LOOP; i++){
            mat<ModInt<mod> > A(V);
            for(auto e : es){
                int r = randval(mt);
                A[e.first][e.second] = r, A[e.second][e.first] = -r;
            }
            cnt[A.rank()]++;
        }
        return (int)(max_element(cnt.begin(), cnt.end()) - cnt.begin()) / 2;
    }
    vector<pair<int, int> > find_maximum_matching(){
        int res = maximum_matchching();
        int newV = 2*(V-res);
        for(int i = 0; i < V; i++) for(int j = V; j < newV; j++) add_edge(i, j);
        for(int i = 0; i < LOOP; i++){
            mat<ModInt<mod> > A(newV);
            for(auto e : es){
                int r = randval(mt);
                A[e.first][e.second] = r, A[e.second][e.first] = -r;
            }
            if(!A.det_zero()) return find_matching(A);
        }
    }
};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m;
    cin >> n >> m;
    Matching mc(n);
    rep(i,m){
        int a,b;
        cin >> a >> b;
        mc.add_edge(a-1,b-1);
    }
    if(mc.perfect_matchching()){
        cout << "Yes\n";
    }else{
        cout << "No\n";
    }
    return 0;
}
accuracy: 0.025
time_ms: 10
memory_kb: 3408
final_rank: 19

code_snippet: #include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto& (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define sar(a,n) cout<<#a<<":";rep(pachico,n)cout<<" "<<a[pachico];cout<<endl

using namespace std;

template<typename S,typename T>auto&operator<<(ostream&o,pair<S,T>p){return o<<"{"<<p.fi<<","<<p.se<<"}";}
template<typename T>auto&operator<<(ostream&o,set<T>s){for(auto&e:s)o<<e<<" ";return o;}
template<typename S,typename T,typename U>
auto&operator<<(ostream&o,priority_queue<S,T,U>q){while(!q.empty())o<<q.top()<<" ",q.pop();return o;}
template<typename K,typename T>auto&operator<<(ostream&o,map<K,T>m){for(auto&e:m)o<<e<<" ";return o;}
template<typename T>auto&operator<<(ostream&o,vector<T>v){for(auto&e:v)o<<e<<" ";return o;}
void ashow(){cout<<endl;}template<typename T,typename...A>void ashow(T t,A...a){cout<<t<<" ";ashow(a...);}

typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<P> vp;
typedef vector<double> vd;
typedef vector<string> vs;

const int MAX_N = 100005;

template <uint mod>
class ModInt {
private:
    uint v;
    static uint norm(const uint& x){ return x < mod ? x : x - mod; }
	static ModInt make(const uint& x){ ModInt m; return m.v = x, m; }
    static ModInt inv(const ModInt& x){ return make(inverse(x.v, mod)); }
    static uint inverse(int a, int m){
        int u[] = {a, 1, 0}, v[] = {m, 0, 1}, t;
        while(*v){
            t = *u / *v;
            swap(u[0] -= t * v[0], v[0]), swap(u[1] -= t * v[1], v[1]), swap(u[2] -= t * v[2], v[2]);
        }
        return (u[1] % m + m) % m;
    }

public:
    ModInt() : v{0}{}
    ModInt(const ll val) : v{norm(val % mod + mod)} {}
    ModInt(const ModInt<mod>& n) : v{n()} {}
	explicit operator bool() const noexcept { return v != 0; }
    bool operator!() const noexcept { return !static_cast<bool>(*this); }
    ModInt<mod>& operator=(const ModInt<mod>& n){ return v = n(), (*this); }
    ModInt<mod>& operator=(const ll val){ return v = norm(val % mod + mod), (*this); }
    ModInt<mod> operator+() const { return *this; }
    ModInt<mod> operator-() const { return v == 0 ? 0 : mod - v; }
    ModInt<mod> operator+(const ModInt<mod>& val) const { return make(norm(v + val())); }
    ModInt<mod> operator-(const ModInt<mod>& val) const { return make(norm(v + mod - val())); }
    ModInt<mod> operator*(const ModInt<mod>& val) const { return make((ll)v * val() % mod); }
    ModInt<mod> operator/(const ModInt<mod>& val) const { return *this * inv(val); }
    ModInt<mod>& operator+=(const ModInt<mod>& val){ return *this = *this + val; }
    ModInt<mod>& operator-=(const ModInt<mod>& val){ return *this = *this - val; }
    ModInt<mod>& operator*=(const ModInt<mod>& val){ return *this = *this * val; }
    ModInt<mod>& operator/=(const ModInt<mod>& val){ return *this = *this / val; }
    ModInt<mod> operator+(const ll val) const { return ModInt{v + val}; }
    ModInt<mod> operator-(const ll val) const { return ModInt{v - val}; }
    ModInt<mod> operator*(const ll val) const { return ModInt{(ll)v * (val % mod)}; }
    ModInt<mod> operator/(const ll val) const { return ModInt{(ll)v * inv(val)}; }
    ModInt<mod>& operator+=(const ll val){ return *this = *this + val; }
    ModInt<mod>& operator-=(const ll val){ return *this = *this - val; }
    ModInt<mod>& operator*=(const ll val){ return *this = *this * val; }
    ModInt<mod>& operator/=(const ll val){ return *this = *this / val; }
    bool operator==(const ModInt<mod>& val) const { return v == val.v; }
    bool operator!=(const ModInt<mod>& val) const { return !(*this == val); }
    bool operator==(const ll val) const { return v == norm(val % mod + mod); }
    bool operator!=(const ll val) const { return !(*this == val); }
    uint operator()() const { return v; }
    friend ModInt operator+(const ll val, const ModInt& n) { return n + val; }
    friend ModInt operator-(const ll val, const ModInt& n) { return ModInt{val - n()}; }
    friend ModInt operator*(const ll val, const ModInt& n) { return n * val; }
    friend ModInt operator/(const ll val, const ModInt& n) { return ModInt{val} / n; }
    friend bool operator==(const ll val, const ModInt& n) { return n == val; }
    friend bool operator!=(const ll val, const ModInt& n) { return !(val == n); }
    friend istream& operator>>(istream& is, ModInt& n){
        uint v;
        return is >> v, n = v, is;
    }
    friend ostream& operator<<(ostream& os, const ModInt& n){ return (os << n()); }
    friend ModInt power(ModInt x, ll n){
        ModInt ans = 1;
        while(n){
            if(n & 1) ans *= x;
            x *= x, n >>= 1;
        }
        return ans;
    }
};

template<typename T> class mat : public vector<vector<T> > {
private:
    int r, c;    //行,列
public:
    inline int row() const { return r; }
    inline int column() const { return c; }
    mat(const int n, const int m, T val = 0)
        : vector<vector<T> >(n, vector<T>(m, val)), r{n}, c{m}{}
    int rank(){
        int res = 0;
        auto& X = (*this);
        for(int i = 0; i < c; i++){
            if(res == r) return res;
            if(!X[res][i]){
                int pivot = res + 1;
                for(; pivot < r; pivot++){
                    if(X[pivot][i]){
                        swap(X[res], X[pivot]);
                        break;
                    }
                }
                if(pivot == r) continue;
            }
            const T p = (T)1 / X[res][i];
            for(int j = i + 1; j < c; j++){ X[res][j] *= p; }
            for(int j = res + 1; j < r; j++){
                for(int k = i + 1; k < c; k++){
                    X[j][k] -= X[res][k] * X[j][i];
                }
            }
            res++;
        }
        return res;
    }
    bool det_zero(){
        auto& X = (*this);
        for(int i = 0; i < c; i++){
            if(!X[i][i]){
                int pivot = i + 1;
                for(; pivot < r; pivot++){
                    if(X[pivot][i]){
                        swap(X[i], X[pivot]);
                        break;
                    }
                }
                if(pivot == r) return true;
            }
            const T p = (T)1 / X[i][i];
            for(int j = i + 1; j < c; j++){ X[i][j] *= p; }
            for(int j = i + 1; j < r; j++){
                for(int k = i + 1; k < c; k++){
                    X[j][k] -= X[i][k] * X[j][i];
                }
            }
        }
        return false;
    }
};

class Matching {
private:
    int V;
    vector<pair<int, int> > es;
    vector<int> cnt;
    random_device rnd;
	mt19937 mt;
    uniform_int_distribution<> randval;
    static constexpr int LOOP = 5;
    static constexpr uint mod = 1000000007;

public:
    Matching(int node_size) : V(node_size), cnt(V+1, 0), mt(rnd()), randval(0, 5){}
    void add_edge(int u, int v){
        if(u > v) swap(u, v);
        es.push_back(make_pair(u, v));
    }
    bool perfect_matchching(){
        for(int i = 0; i < LOOP; i++){
            mat<ModInt<mod> > A(V, V);
            for(auto e : es){
                int r = randval(mt);
                if(e.first){
                    A[e.first][e.second] = r, A[e.second][e.first] = -r;
                }else{
                    A[e.first][e.second] = r;
                    A[e.second][e.first] = randval(mt);
                }
            }
            if(!A.det_zero()) return true;
        }
        return false;
    }
    int maximum_matchching(){
        for(int i = 0; i < LOOP; i++){
            mat<ModInt<mod> > A(V, V);
            for(auto e : es){
                int r = randval(mt);
                A[e.first][e.second] = r, A[e.second][e.first] = -r;
            }
            cnt[A.rank()]++;
        }
        return (int)(max_element(cnt.begin(), cnt.end()) - cnt.begin()) / 2;
    }
};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m;
    cin >> n >> m;
    Matching mc(n);
    rep(i,m){
        int a,b;
        cin >> a >> b;
        mc.add_edge(a-1,b-1);
    }
    if(mc.perfect_matchching()){
        cout << "Yes\n";
    }else{
        cout << "No\n";
    }
    return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 3380
final_rank: 2

code_snippet: #include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto& (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define sar(a,n) cout<<#a<<":";rep(pachico,n)cout<<" "<<a[pachico];cout<<endl
#define svec(v) cout<<#v<<":";rep(pachico,v.size())cout<<" "<<v[pachico];cout<<endl
#define svecp(v) cout<<#v<<":";each(pachico,v)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl
#define sset(s) cout<<#s<<":";each(pachico,s)cout<<" "<<pachico;cout<<endl
#define smap(m) cout<<#m<<":";each(pachico,m)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<P> vp;
typedef vector<string> vs;

const int MAX_N = 100005;

template<typename T> class mat : public vector<vector<T> > {
private:
    int r,c;    //行,列
public:
    inline int row() const {
        return r;
    }
    inline int column() const {
        return c;
    }
    mat(int n, int m, T val = 0){
        r = n, c = m;
        for(int i = 0; i < n; i++){
            this->push_back(vector<T>(m, val));
        }
    }
    int rank(){
        int res = 0;
        for(int i = 0; i < c; i++){
            if(res == r) return res;
            int pivot = res;
            for(int j = res + 1; j < r; j++){
                if(abs((*this)[j][i]) > abs((*this)[pivot][i])){
                    pivot = j;
                }
            }
            if(abs((*this)[pivot][i]) < EPS) continue;
            swap((*this)[pivot],(*this)[res]);
            for(int j = i + 1; j < c; j++){
                (*this)[res][j] /= (*this)[res][i];
            }
            for(int j = res + 1; j < r; j++){
                for(int k = i + 1; k < c; k++){
                    (*this)[j][k] -= (*this)[res][k]*(*this)[j][i];
                }
            }
            res++;
        }
        return res;
    }
    T det(){
        T ans = 1;
        mat B(r, r);
        for(int i = 0; i < r; i++){
            for(int j = 0; j < c; j++){
                B[i][j] = (*this)[i][j];
            }
        }
        for(int i = 0; i < c; i++){
            int pivot = i;
            for(int j = i + 1; j < r; j++){
                if(abs(B[j][i]) > abs(B[pivot][i])){
                    pivot = j;
                }
            }
            if(abs(B[pivot][i]) < EPS) return (T)0;
            if(pivot != i) swap(B[i], B[pivot]), ans = -ans;
            ans *= B[i][i];
            for(int j = i + 1; j < r; j++){
                for(int k = c - 1; k >= i; k--){
                    B[j][k] -= B[i][k] * B[j][i] / B[i][i];
                }
            }
        }
        return ans;
    }
    inline void print() const {
        for(int i = 0; i < r; i++){
            for(int j = 0; j < (c-1); j++){
                cout << (*this)[i][j] << ",";
            }
            cout << (*this)[i][c-1] << endl;
        }
    }
};

class Matching {
private:
    int V;
    vector<pair<int, int> > es;
    const int LOOP = 100;
    unsigned long rnd(){
        static unsigned long long x = 123456789, y = 362436069, z = 521288629, w = 86675123;
        unsigned long long t = (x^(x<<11));
        x = y,y = z,z = w;
        return (w = (w^(w>>19))^(t^(t>>8)));
    }
    
public:
    Matching(int node_size) : V(node_size){}
    void add_edge(int u, int v){
        if(u > v) swap(u, v);
        es.push_back(make_pair(u, v));
    }
    // bool perfect_matchching(){
    //     for(int i = 0; i < LOOP; i++){
    //         mat<double> A(V, V);
    //         for(auto e : es){
    //             double r = (double)rnd()/((double)ULONG_MAX+1);
    //             A[e.first][e.second] = r, A[e.second][e.first] = -r;
    //         }
    //         if(abs(A.det()) > EPS) return true;
    //     }
    //     return false;
    // }
    bool perfect_matchching(){
        for(int i = 0; i < LOOP; i++){
            mat<double> A(V, V);
            for(auto e : es){
                double r = (double)rnd()/((double)ULONG_MAX+1);
                if(e.first){
                    A[e.first][e.second] = r, A[e.second][e.first] = -r;
                }else{
                    A[e.first][e.second] = r;
                    double s = (double)rnd()/((double)ULONG_MAX+1);
                    A[e.second][e.first] = s;
                }
            }
            if(abs(A.det()) > EPS) return true;
        }
        return false;
    }
    int maximal_matchching(){
        int res = 0;
        for(int i = 0; i < LOOP; i++){
            mat<double> A(V, V);
            for(auto e : es){
                double r = (double)rnd()/((double)ULONG_MAX+1);
                A[e.first][e.second] = r, A[e.second][e.first] = -r;
            }
            res = max(res, A.rank());
        }
        return res / 2;
    }
};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m;
    cin >> n >> m;
    Matching mc(n);
    rep(i,m){
        int a,b;
        cin >> a >> b;
        mc.add_edge(a-1,b-1);
    }
    if(mc.perfect_matchching()){
        cout << "Yes\n";
    }else{
        cout << "No\n";
    }
    return 0;
}
accuracy: 1
time_ms: 680
memory_kb: 3592
final_rank: 8

code_snippet: #include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto& (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define sar(a,n) cout<<#a<<":";rep(pachico,n)cout<<" "<<a[pachico];cout<<endl
#define svec(v) cout<<#v<<":";rep(pachico,v.size())cout<<" "<<v[pachico];cout<<endl
#define svecp(v) cout<<#v<<":";each(pachico,v)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl
#define sset(s) cout<<#s<<":";each(pachico,s)cout<<" "<<pachico;cout<<endl
#define smap(m) cout<<#m<<":";each(pachico,m)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<P> vp;
typedef vector<string> vs;

const int MAX_N = 100005;

template<typename T> class mat : public vector<vector<T> > {
private:
    int r,c;    //行,列
public:
    inline int row() const {
        return r;
    }
    inline int column() const {
        return c;
    }
    mat(int n, int m, T val = 0){
        r = n, c = m;
        for(int i = 0; i < n; i++){
            this->push_back(vector<T>(m, val));
        }
    }
    int rank(){
        int res = 0;
        for(int i = 0; i < c; i++){
            if(res == r) return res;
            int pivot = res;
            for(int j = res + 1; j < r; j++){
                if(abs((*this)[j][i]) > abs((*this)[pivot][i])){
                    pivot = j;
                }
            }
            if(abs((*this)[pivot][i]) < EPS) continue;
            swap((*this)[pivot],(*this)[res]);
            for(int j = i + 1; j < c; j++){
                (*this)[res][j] /= (*this)[res][i];
            }
            for(int j = res + 1; j < r; j++){
                for(int k = i + 1; k < c; k++){
                    (*this)[j][k] -= (*this)[res][k]*(*this)[j][i];
                }
            }
            res++;
        }
        return res;
    }
    T det(){
        T ans = 1;
        mat B(r, r);
        for(int i = 0; i < r; i++){
            for(int j = 0; j < c; j++){
                B[i][j] = (*this)[i][j];
            }
        }
        for(int i = 0; i < c; i++){
            for(int j = i + 1; j < r; j++){
                if(abs(B[j][i]) > EPS){
                    swap(B[i], B[j]);
                    ans = -ans;
                    break;
                }
            }
            ans *= B[i][i];
            for(int j = i + 1; j < r; j++){
                for(int k = c - 1; k >= i; k--){
                    B[j][k] -= B[i][k] * B[j][i] / B[i][i];
                }
            }
        }
        return ans;
    }
    inline void print() const {
        for(int i = 0; i < r; i++){
            for(int j = 0; j < (c-1); j++){
                cout << (*this)[i][j] << ",";
            }
            cout << (*this)[i][c-1] << endl;
        }
    }
};

class Matching {
private:
    int V;
    vector<pair<int, int> > es;
    const int LOOP = 100;
    unsigned long rnd(){
        static unsigned long long x = 123456789, y = 362436069, z = 521288629, w = 86675123;
        unsigned long long t = (x^(x<<11));
        x = y,y = z,z = w;
        return (w = (w^(w>>19))^(t^(t>>8)));
    }
    
public:
    Matching(int node_size) : V(node_size){}
    void add_edge(int u, int v){
        if(u > v) swap(u, v);
        es.push_back(make_pair(u, v));
    }
    bool perfect_matchching(){
        int res = 0;
        for(int i = 0; i < LOOP; i++){
            mat<double> A(V, V);
            for(auto e : es){
                double r = (double)rnd()/((double)ULONG_MAX+1);
                A[e.first][e.second] = r, A[e.second][e.first] = -r;
            }
            res = max(res, A.rank());
        }
        return (res == V);
    }
    int maximal_matchching(){
        int res = 0;
        for(int i = 0; i < LOOP; i++){
            mat<double> A(V, V);
            for(auto e : es){
                double r = (double)rnd()/((double)ULONG_MAX+1);
                A[e.first][e.second] = r, A[e.second][e.first] = -r;
            }
            res = max(res, A.rank());
        }
        return res / 2;
    }
};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m;
    cin >> n >> m;
    Matching mc(n);
    rep(i,m){
        int a,b;
        cin >> a >> b;
        mc.add_edge(a-1,b-1);
    }
    if(mc.perfect_matchching()){
        cout << "Yes\n";
    }else{
        cout << "No\n";
    }
    return 0;
}
accuracy: 0.025
time_ms: 160
memory_kb: 3272
final_rank: 20

code_snippet: #include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto& (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define sar(a,n) cout<<#a<<":";rep(pachico,n)cout<<" "<<a[pachico];cout<<endl
#define svec(v) cout<<#v<<":";rep(pachico,v.size())cout<<" "<<v[pachico];cout<<endl
#define svecp(v) cout<<#v<<":";each(pachico,v)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl
#define sset(s) cout<<#s<<":";each(pachico,s)cout<<" "<<pachico;cout<<endl
#define smap(m) cout<<#m<<":";each(pachico,m)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<P> vp;
typedef vector<string> vs;

const int MAX_N = 100005;

template<typename T> class mat : public vector<vector<T> > {
private:
    int r,c;    //行,列
public:
    inline int row() const {
        return r;
    }
    inline int column() const {
        return c;
    }
    mat(int n, int m, T val = 0){
        r = n, c = m;
        for(int i = 0; i < n; i++){
            this->push_back(vector<T>(m, val));
        }
    }
    int rank(){
        int res = 0;
        for(int i = 0; i < c; i++){
            if(res == r) return res;
            int pivot = res;
            for(int j = res + 1; j < r; j++){
                if(abs((*this)[j][i]) > abs((*this)[pivot][i])){
                    pivot = j;
                }
            }
            if(abs((*this)[pivot][i]) < EPS) continue;
            swap((*this)[pivot],(*this)[res]);
            for(int j = i + 1; j < c; j++){
                (*this)[res][j] /= (*this)[res][i];
            }
            for(int j = res + 1; j < r; j++){
                for(int k = i + 1; k < c; k++){
                    (*this)[j][k] -= (*this)[res][k]*(*this)[j][i];
                }
            }
            res++;
        }
        return res;
    }
    T det(){
        T ans = 1;
        mat B(r, r);
        for(int i = 0; i < r; i++){
            for(int j = 0; j < r; j++){
                B[i][j] = (*this)[i][j];
            }
        }
        for(int i = 0; i < c; i++){
            for(int j = i + 1; j < r; j++){
                if(abs(B[j][i]) > EPS){
                    swap(B[i], B[j]);
                    ans = -ans;
                    break;
                }
            }
            ans *= B[i][i];
            for(int j = i + 1; j < r; j++){
                for(int k = c - 1; k >= i; k--){
                    B[j][k] -= B[i][k] * B[j][i] / B[i][i];
                }
            }
        }
        return ans;
    }
    inline void print() const {
        for(int i = 0; i < r; i++){
            for(int j = 0; j < (c-1); j++){
                cout << (*this)[i][j] << ",";
            }
            cout << (*this)[i][c-1] << endl;
        }
    }
};

class Matching {
private:
    int V;
    vector<pair<int, int> > es;
    const int LOOP = 100;
    unsigned long rnd(){
        static unsigned long long x = 123456789, y = 362436069, z = 521288629, w = 86675123;
        unsigned long long t = (x^(x<<11));
        x = y,y = z,z = w;
        return (w = (w^(w>>19))^(t^(t>>8)));
    }
    
public:
    Matching(int node_size) : V(node_size){}
    void add_edge(int u, int v){
        if(u > v) swap(u, v);
        es.push_back(make_pair(u, v));
    }
    bool perfect_matchching(){
        for(int i = 0; i < LOOP; i++){
            mat<double> A(V, V);
            for(auto e : es){
                double r = (double)rnd()/((double)ULONG_MAX+1);
                if(e.first){
                    A[e.first][e.second] = r, A[e.second][e.first] = -r;
                }else{
                    A[e.first][e.second] = r;
                    double s = (double)rnd()/((double)ULONG_MAX+1);
                    A[e.second][e.first] = s;
                }
            }
            if(abs(A.det()) > EPS) return true;
        }
        return false;
    }
    int maximal_matchching(){
        int res = 0;
        for(int i = 0; i < LOOP; i++){
            mat<double> A(V, V);
            for(auto e : es){
                double r = (double)rnd()/((double)ULONG_MAX+1);
                A[e.first][e.second] = r, A[e.second][e.first] = -r;
            }
            res = max(res, A.rank());
        }
        return res / 2;
    }
};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m;
    cin >> n >> m;
    Matching mc(n);
    rep(i,m){
        int a,b;
        cin >> a >> b;
        mc.add_edge(a-1,b-1);
    }
    if(mc.perfect_matchching()){
        cout << "Yes\n";
    }else{
        cout << "No\n";
    }
    return 0;
}
accuracy: 0.625
time_ms: 530
memory_kb: 3704
final_rank: 15

code_snippet: #include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto& (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define sar(a,n) cout<<#a<<":";rep(pachico,n)cout<<" "<<a[pachico];cout<<endl
#define svec(v) cout<<#v<<":";rep(pachico,v.size())cout<<" "<<v[pachico];cout<<endl
#define svecp(v) cout<<#v<<":";each(pachico,v)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl
#define sset(s) cout<<#s<<":";each(pachico,s)cout<<" "<<pachico;cout<<endl
#define smap(m) cout<<#m<<":";each(pachico,m)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<P> vp;
typedef vector<string> vs;

const int MAX_N = 100005;

template<typename T> class mat : public vector<vector<T> > {
private:
    int r,c;    //行,列
public:
    inline int row() const {
        return r;
    }
    inline int column() const {
        return c;
    }
    mat(int n, int m, T val = 0){
        r = n, c = m;
        for(int i = 0; i < n; i++){
            this->push_back(vector<T>(m, val));
        }
    }
    int rank(){
        int res = 0;
        for(int i = 0; i < c; i++){
            if(res == r) return res;
            int pivot = res;
            for(int j = res + 1; j < r; j++){
                if(abs((*this)[j][i]) > abs((*this)[pivot][i])){
                    pivot = j;
                }
            }
            if(abs((*this)[pivot][i]) < EPS) continue;
            swap((*this)[pivot],(*this)[res]);
            for(int j = i + 1; j < c; j++){
                (*this)[res][j] /= (*this)[res][i];
            }
            for(int j = res + 1; j < r; j++){
                for(int k = i + 1; k < c; k++){
                    (*this)[j][k] -= (*this)[res][k]*(*this)[j][i];
                }
            }
            res++;
        }
        return res;
    }
    T det(){
       //  T ans = 1;
       //  for(int i = 0; i < r; i++){
       //      for(int j = i + 1; j < r; j++){
       //          T r = (*this)[i][i] / (*this)[j][i];
       //          for(int k = i; k < r; k++) {
       //              T t = (*this)[i][k] - r * (*this)[j][k];
       //              (*this)[i][k] = (*this)[j][k];
       //              (*this)[j][k] = t;
       //          }
       //          ans = -ans;
       //     }
       //     ans *= (*this)[i][i];
       // }
       // return ans;
       T ans = 1;
       for(int i = 0; i < c; i++){
           int pivot = i;
           for(int j = i + 1; j < r; j++){
               if(abs((*this)[j][i]) > abs((*this)[pivot][i])){
                   pivot = j;
               }
           }
           if(abs((*this)[pivot][i]) < EPS) return (T)0;
           swap((*this)[pivot],(*this)[i]);
           ans *= (*this)[i][i];
           for(int j = i + 1; j < c; j++){
               (*this)[i][j] /= (*this)[i][i];
           }
           for(int j = i + 1; j < r; j++){
               for(int k = i + 1; k < c; k++){
                   (*this)[j][k] -= (*this)[i][k]*(*this)[j][i];
               }
           }
       }
       return ans;
    }
    inline void print() const {
        for(int i = 0; i < r; i++){
            for(int j = 0; j < (c-1); j++){
                cout << (*this)[i][j] << ",";
            }
            cout << (*this)[i][c-1] << endl;
        }
    }
};

class Matching {
private:
    int V;
    vector<pair<int, int> > es;
    const int LOOP = 10;
    unsigned long rnd(){
        static unsigned long long x = 123456789, y = 362436069, z = 521288629, w = 86675123;
        unsigned long long t = (x^(x<<11));
        x = y,y = z,z = w;
        return (w = (w^(w>>19))^(t^(t>>8)));
    }
    
public:
    Matching(int node_size) : V(node_size){}
    void add_edge(int u, int v){
        if(u > v) swap(u, v);
        es.push_back(make_pair(u, v));
    }
    bool perfect_matchching(){
        for(int i = 0; i < LOOP; i++){
            mat<double> A(V, V);
            for(auto e : es){
                double r = (double)rnd()/((double)ULONG_MAX+1);
                if(e.first){
                    A[e.first][e.second] = r, A[e.second][e.first] = -r;
                }else{
                    A[e.first][e.second] = r;
                    double s = (double)rnd()/((double)ULONG_MAX+1);
                    A[e.second][e.first] = s;
                }
            }
            if(abs(A.det()) > EPS) return true;
        }
        return false;
    }
    int maximal_matchching(){
        int res = 0;
        for(int i = 0; i < LOOP; i++){
            mat<double> A(V, V);
            for(auto e : es){
                double r = (double)rnd()/((double)ULONG_MAX+1);
                A[e.first][e.second] = r, A[e.second][e.first] = -r;
            }
            res = max(res, A.rank());
        }
        return res / 2;
    }
};

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m;
    cin >> n >> m;
    Matching mc(n);
    rep(i,m){
        int a,b;
        cin >> a >> b;
        mc.add_edge(a-1,b-1);
    }
    if(mc.perfect_matchching()){
        cout << "Yes\n";
    }else{
        cout << "No\n";
    }
    return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 3364
final_rank: 1