#include <bits/stdc++.h>
#define int long long
using namespace std;
constexpr int N = 1000010;
int n, q, c[N];
int lowbit(int x) {return (x&(-x));}
void update(int x, int v) {
while (x <= n) {
c[x] += v;
x += lowbit(x);
}
}
int query(int x) {
int cnt = 0;
while (x) {
cnt += c[x];
x -= lowbit(x);
}
return cnt;
}
mt19937 rng(time(0));
signed main() {
freopen("circle.in", "r", stdin);
freopen("circle.out", "w", stdout);
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
cin >> n >> q;
while (q--) {
int x, y;
cin >> x >> y;
if (x > y) swap(x, y);
if (query(x) == query(y)) {
cout << "Yes\n";
int z = rng();
update(x, z);
update(y + 1, -z);
} else cout << "No\n";
}
return 0;
}