#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma G++ optimize(2)
using namespace std;
char nc() { return getchar(); }
int read() {
  int x = 0, y = 1;
  char c = nc();
  while (!isdigit(c)) {
    if (c == '-') y = -1;
    c = nc();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = nc();
  }
  return x * y;
}
int n, q, ANS[100005];
map<pair<int, int>, int> mp;
int tl[100005 << 2], tr[100005 << 2], prt[100005], sz[100005], val[100005],
    stax[100005], stay[100005], top = 0;
vector<int> inx[100005 << 2], iny[100005 << 2];
void build(int rt, int l, int r) {
  tl[rt] = l;
  tr[rt] = r;
  if (l == r) return;
  build((rt << 1), l, (l + r >> 1));
  build((rt << 1 | 1), (l + r >> 1) + 1, r);
}
void insert(int rt, int l, int r, int x, int y) {
  if (tl[rt] >= l && tr[rt] <= r) {
    inx[rt].push_back(x);
    iny[rt].push_back(y);
    return;
  }
  int md = tl[rt] + tr[rt] >> 1;
  if (l <= md) insert((rt << 1), l, r, x, y);
  if (r > md) insert((rt << 1 | 1), l, r, x, y);
}
int findprt(int x) { return x == prt[x] ? x : findprt(prt[x]); }
int findval(int x) { return x == prt[x] ? 0 : val[x] ^ findval(prt[x]); }
bool merge(int x, int y) {
  int v = findval(x) ^ findval(y) ^ 1;
  x = findprt(x);
  y = findprt(y);
  if (x == y) return v;
  if (sz[x] < sz[y]) swap(x, y);
  prt[y] = x;
  sz[x] += sz[y];
  val[y] = v;
  top++;
  stax[top] = x;
  stay[top] = y;
  return 0;
}
void del(int tp) {
  while (top > tp) {
    int x = stax[top], y = stay[top];
    prt[y] = y;
    sz[x] -= sz[y];
    val[y] = 0;
    top--;
  }
}
void dfs(int rt) {
  int tp = top;
  for (int i = 0, up = inx[rt].size(); i < up; i++)
    if (merge(inx[rt][i], iny[rt][i])) {
      del(tp);
      for (int j = tl[rt]; j <= tr[rt]; j++) ANS[j] = 0;
      return;
    }
  if (tl[rt] == tr[rt]) {
    ANS[tl[rt]] = 1;
    return;
  }
  dfs((rt << 1));
  dfs((rt << 1 | 1));
  del(tp);
}
int main() {
  n = read();
  q = read();
  for (int i = 1; i <= n; i++) prt[i] = i, sz[i] = 1, val[i] = 0;
  int x, y;
  build(1, 1, q);
  for (int i = 1; i <= q; i++) {
    x = read();
    y = read();
    pair<int, int> tp = make_pair(x, y);
    if (mp.count(tp)) {
      insert(1, mp[tp], i - 1, tp.first, tp.second);
      mp.erase(tp);
    } else
      mp[tp] = i;
  }
  for (map<pair<int, int>, int>::iterator it = mp.begin(); it != mp.end(); it++)
    insert(1, (*it).second, q, (*it).first.first, (*it).first.second);
  dfs(1);
  for (int i = 1; i <= q; i++) puts(ANS[i] ? "YES" : "NO");
  return 0;
}
