Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;
int N, M;
set<int> pathes[100500];
int degree[100500];
vector<int> tour;
int start;
int num_circuit = 0;
int before[100500];

void bfs(int from) {
    if(pathes[from].empty()) return;
    tour.push_back(from);
    auto itr = pathes[from].begin();
    auto hoge = *itr
    pathes[from].erase(*itr);
    auto itr2 = pathes[hoge].lower_bound(from);
    pathes[hoge].erase(itr2);
    degree[from]--;
    degree[hoge]--;
    bfs(hoge);
}

void solve() {
    //cout.precision(10);
    bool win = false;
    start = -1;
    for(int i = 1; i <= N; i++) {
        if(degree[i] % 2 != 0) {
            //cout << "No" << endl;
            num_circuit = -99;
            return;
        }
        if(degree[i] > 0) start = i;
        if(degree[i] >= 6) win = true;
    }
    if(win) {
        //cout << "Yes" << endl;
        //cerr << "a" << endl;
        num_circuit = 99;
        return;
    }
    //cerr << start << endl;
    if(start == -1) {
        //cout << "No" << endl;
        num_circuit = -99;
        return;
    }
    //start = 1;
    tour.clear();
    bfs(start);
    for(int i = 1; i <= N; i++) {
        before[i] = -1;
    }
    vector<l_l> circuit;
    //for(int i = 0; i < tour.size(); i++) cout << tour[i] << endl;
    //cout << endl;
    for(int i = 1; i < tour.size(); i++) {
        int val = tour[i];
        if(before[val] != -1) {
            circuit.push_back({before[val], i});
        }
        before[val] = i;
    }
    num_circuit++;
    if(circuit.size() == 0) {
        //cout << "No" << endl;
        return;
    }
    num_circuit++;
    ll RIGHT = 1e7;
    ll LEFT = -1e7;
    sort(circuit.begin(), circuit.end());
    /*
    for(int i = 0; i < circuit.size(); i++) {
        RIGHT = min((ll)RIGHT, circuit[i].second);
        if(circuit[i].second < circuit.back().first) {
            //cout << "Yes" << endl;
            //cerr << "b" << endl;
            num_circuit = 99;
            return;
        }
    }
    for(int i = 0; i < circuit.size(); i++) {
        if(RIGHT < circuit[i].first) {
            num_circuit = 99;
            return;
        }
    }
    */
    for(int i = 0; i < circuit.size(); i++) {
        RIGHT = min(RIGHT, circuit[i].second);
        LEFT = max(LEFT, circuit[i].first);
    }
    if(LEFT > RIGHT) {
        num_circuit = 99;
        return;
    }
    int r = -1;
    for(int i = 0; i < circuit.size(); i++) {
        if(circuit[i].second < r) {
            //cout << "Yes" << endl;
            num_circuit = 99;
            //cerr << "c" << endl;
            return;
        }
        r = max((ll)r, circuit[i].second);
    }
    //cout << "No" << endl;
    return;
}

int main() {
    cin >> N >> M;
    cin.tie(0);
    ios::sync_with_stdio(false);
    for(int i = 1; i <= M; i++) {
        int a, b;
        cin >> a >> b;
        pathes[a].insert(b);
        pathes[b].insert(a);
        degree[a]++;
        degree[b]++;
        cerr << a << " " << b << endl;
    }
    while(true) {
        //for(int i = 1; i <= N; i++) degree[i] = pathes[i].size();
        for(int i = 1; i <= N; i++) cerr << i << " " << degree[i] << endl;;
        solve();
        //cerr << num_circuit << endl;
        if(num_circuit >= 3) {
            cout << "Yes" << endl;
            return 0;
        }
        if(num_circuit < 0) {
            cout << "No" << endl;
            return 0;
        }
    }
}


Compiler output:
a.cc: In function 'void bfs(int)':
a.cc:23:5: error: expected ',' or ';' before 'pathes'
   23 |     pathes[from].erase(*itr);
      |     ^~~~~~