#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef pair<int,int> pint;
typedef pair<ll,ll> pll;

#define FI first
#define SE second
#define PB push_back
#define MP make_pair
#define ALL(s) (s).begin(),(s).end()
#define REP(i,n) for (int i = 0; i < (int)(n); ++i)
#define EACH(i,s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<<endl

template<class T1, class T2> ostream& operator<<(ostream &s, pair<T1,T2> P){return s<<'<'<<P.first<<", "<<P.second<<'>';}
template<class T> ostream& operator<<(ostream &s, vector<T> P) {s<<"{ ";for(int i=0;i<P.size();++i){if(i>0)s<<", ";s<<P[i];}return s<<" }"<<endl;}
template<class T1, class T2> ostream& operator<<(ostream &s, map<T1,T2> P) {s<<"{ ";for(__typeof__(P.begin()) it=P.begin();it!=P.end();++it){if(it!=P.begin())s<<", ";s<<'<'<<it->first<<"->"<<it->second<<'>';}return s<<" }"<<endl;}



struct Edge {
    int rev, from, to, cap, icap, flow;
    Edge() {}
    Edge(int r, int f, int t, int c) : rev(r), from(f), to(t), cap(c), icap(c), flow(0) {}
};

const int MAX_V = 300;
const int INF = 1<<29;
struct Graph {
    int V,E;
    vector<Edge> list[MAX_V];
    
    Graph(int n = 0) : V(n), E(0) {}
    void init(int n = 0) {V = n; E = 0; for (int i = 0; i < MAX_V; ++i) list[i].clear();}
    void resize(int n = 0) {V = n;}
    void reset() {for (int i = 0; i < V; ++i) for (int j = 0; j < list[i].size(); ++j) list[i][j].cap = list[i][j].icap;}    
    inline vector<Edge>& operator [] (int i) {return list[i];}
    
    void addedge(int from, int to, int cap) {
        if (cap > 0) {
            ++E;
            list[from].push_back(Edge(list[to].size(), from, to, cap));
            list[to].push_back(Edge(list[from].size()-1, to, from, 0));
        }
    }
    
    Edge &redge(Edge e) {
        if (e.from != e.to) return list[e.to][e.rev];
        else return list[e.to][e.rev+1];
    }
};

Graph G;


// &#201;O&#201;&#226;&#201;t&#199;&#195;&#201;f&#201;o&#201;b&#201;N&#232;o&#243;&#213;
// &#237;&#160;&#232;&#204;
ostream& operator << (ostream& s, const Edge& E) {
    return s << E.from << "->" << E.to << '(' << E.cap << ')';
}

ostream& operator << (ostream& s, const Graph& G) {
    for (int i = 0; i < G.V; ++i) {s << i << " : " << G.list[i];}
    return s;
}

int level[MAX_V];
int iter[MAX_V];

void dibfs(Graph &G, int s) {
    memset(level, -1, sizeof(level));
    level[s] = 0;
    queue<int> que;
    que.push(s);
    while (!que.empty()) {
        int v = que.front();
        que.pop();
        for (int i = 0; i < G[v].size(); ++i) {
            Edge &e = G[v][i];
            if (level[e.to] < 0 && e.cap > 0) {
                level[e.to] = level[v] + 1;
                que.push(e.to);
            }
        }
    }
}

int didfs(Graph &G, int v, int t, int f) {
    if (v == t) return f;
    for(int &i = iter[v]; i < G[v].size(); ++i) {
        Edge &e = G[v][i], &re = G.redge(e);
        if (level[v] < level[e.to] && e.cap > 0) {
            int d = didfs(G, e.to, t, min(f, e.cap));
            if (d > 0) {
                e.cap -= d;
                re.cap += d;
                return d;
            }
        }
    }
    return 0;
}

int Dinic(Graph &G, int s, int t) {
    int res = 0;
    while (true) {
        dibfs(G, s);
        if (level[t] < 0) return res;
        memset(iter, 0, sizeof(iter));
        int flow;
        while ((flow = didfs(G, s, t, INF)) > 0) {
            res += flow;
        }
    }
}



int N, M;
int a, b;

int main() {
	while (cin >> N >> M) {
		G.init(N*2+1);
		G.addedge(0, N, 2);
		for (int i = 1; i < N; ++i) G.addedge(i, i+N, 1);
		int s = 0, t = N*2;

		for (int i = 0; i < M; ++i) {
			cin >> a >> b; --a; --b;

			Graph tG = G;
			tG.addedge(a+N, t, 1); tG.addedge(b+N, t, 1);

			//COUT(tG);
	
			int res = Dinic(tG, s, t);

			//COUT(res);

			if (res >= 2) cout << "Yes" << endl;
			else cout << "No" << endl;

			//if (b != 0) 
				G.addedge(a+N, b, 1);
			//if (a != 0) 
				G.addedge(b+N, a, 1);
		}
	}
    
    return 0;
}


Measured memory_bytes: 2364