Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(long long i=0; i<(long long)(n); i++)
#define REP(i, k, n) for(long long i=(long long)(k); i<(long long)(n); i++)
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define PQ(T) priority_queue<T>
#define PQS(T) priority_queue<T, vector<T>, greater<T> >
#define deci cout << fixed << setprecision(15);
typedef long long ll;
const ll inf = 1020304050607080910;
const int mod = 1000000007;
typedef pair<ll, ll> P;
typedef pair<P, ll> PP;
template<class T> bool chmin(T&x,T y){if(x>y){x=y;return true;}return false;}
template<class T> bool chmax(T&x,T y){if(x<y){x=y;return true;}return false;}
ll gcd(ll x,ll y){if(x>y)swap(x, y);while(x!=0){y%=x;swap(x, y);}return y;}
ll mpow(ll x,ll r){if(r==0)return 1;if(r%2==1){return x*mpow(x,r-1)%mod;}else{ll aa=mpow(x,r/2);return aa*aa%mod;}}

int N, M, f, f2, num, s, deg[100000], index[100000], used[100000];
vector<P> G[100000];

int main(){
	cin >> N >> M;
	rep(i, M){
		int a, b; cin >> a >> b;
		a--; b--;
		G[a].pb(P(b, i)); G[b].pb(P(a, i));
		deg[a]++; deg[b]++;
	}
	rep(i, N){
		if(deg[i] % 2 == 1) f2 = 1;
		if(deg[i] >= 6) f = 1;
		if(deg[i] == 4){ num++; s = i; }
	}
	if(f || num > 2){
		cout << "Yes" << endl;
		return 0;
	}
	if(f2 || num < 2){
		cout << "No" << endl;
		return 0;
	}
	rep(i, 2){
		int now = s, cnt = 1, e;
		queue<int> que;
		while(1){
			if(index[now] != 0){
				M -= cnt - index[now];
				rep(j, index[now]-1){
					int aa = que.front(); que.pop();
					used[aa] = 0;
				}
			}else{
				index[now] = cnt;
				cnt++;
				rep(j, G[now].size()){
					if(used[G[now][j].second]) continue;
					else{
						que.push(G[now][j].second);
						e = G[now][j].second;
						now = G[now][j].first;
						used[G[now][j].second] = 1;
					}
				}
			}
		}
	}
	cout << (M?"Yes":"No") << endl;
	return 0;
}


Compiler output:
a.cc:20:51: error: 'int index [100000]' redeclared as different kind of entity
   20 | int N, M, f, f2, num, s, deg[100000], index[100000], used[100000];
      |                                                   ^
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:1:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:48:33: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   48 |                         if(index[now] != 0){
      |                                 ^
a.cc:49:49: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   49 |                                 M -= cnt - index[now];
      |                                                 ^
a.cc:50:45: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   50 |                                 rep(j, index[now]-1){
      |                                             ^
a.cc:3:52: note: in definition of macro 'rep'
    3 | #define rep(i, n) for(long long i=0; i<(long long)(n); i++)
      |                                                    ^
a.cc:55:38: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   55 |                                 index[now] = cnt;
      |                                      ^