#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long f = 1, x = 0;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = x * 10 - '0' + s;
    s = getchar();
  }
  return x * f;
}
inline long long qkmul(long long x, long long y, long long mod) {
  long long tmp =
      (x * y - (long long)((long double)x / mod * y + 1.0e-8) * mod);
  return tmp < 0 ? tmp + mod : tmp;
}
struct np {
  int a, b;
  inline np() { a = b = 0; }
  inline np(int A, int B) {
    a = A;
    b = B;
  }
};
int n, m, i, j, s, o, k;
int fa[100005], dt[100005], siz[100005];
int ans[100005];
map<int, map<int, int> > b;
inline np find(int x) {
  if (fa[x] == x) return np(x, 0);
  np as = find(fa[x]);
  return np(as.a, as.b ^ dt[x]);
}
vector<np> tre[100005 << 2];
stack<np> st[100005 * 3];
inline void addtree(int a, int l, int r, np y, int al, int ar) {
  if (al > r || ar < l) return;
  if (al >= l && ar <= r) {
    tre[a].push_back(y);
    return;
  }
  int mid = al + ar >> 1;
  addtree(a << 1, l, r, y, al, mid);
  addtree(a << 1 | 1, l, r, y, mid + 1, ar);
  return;
}
inline void pushdown(int a, int al, int ar, int as) {
  for (int i = 0; i < tre[a].size(); i++) {
    s = tre[a][i].a;
    o = tre[a][i].b;
    np u = find(s), v = find(o);
    if (u.a != v.a) {
      int dd = 1 ^ u.b ^ v.b;
      if (siz[u.a] > siz[v.a]) swap(u, v), swap(s, o);
      dt[u.a] = dd;
      fa[u.a] = v.a;
      st[a].push(np(u.a, v.a));
      siz[v.a] += siz[u.a];
    } else if (u.b == v.b)
      as = 1;
  }
  if (al == ar) {
    ans[al] = as;
  } else {
    int mid = al + ar >> 1;
    pushdown(a << 1, al, mid, as);
    pushdown(a << 1 | 1, mid + 1, ar, as);
  }
  while (!st[a].empty()) {
    s = st[a].top().a, o = st[a].top().b;
    st[a].pop();
    fa[s] = s;
    dt[s] = 0;
    siz[o] -= siz[s];
  }
  return;
}
signed main() {
  n = read();
  m = read();
  stack<np> ss;
  for (int i = 1; i <= n; i++) fa[i] = i, siz[i] = 1;
  for (int i = 1; i <= m; i++) {
    s = read();
    o = read();
    if (s > o) swap(s, o);
    int ll;
    if (!(ll = b[s][o]))
      b[s][o] = i, ss.push(np(s, o));
    else
      addtree(1, ll, i - 1, np(s, o), 1, m), b[s][o] = 0;
  }
  while (!ss.empty()) {
    s = ss.top().a, o = ss.top().b;
    int ll;
    if (ll = b[s][o]) {
      addtree(1, ll, m, ss.top(), 1, m);
      b[s][o] = 0;
    }
    ss.pop();
  }
  pushdown(1, 1, m, 0);
  for (int i = 1; i <= m; i++) {
    printf(ans[i] ? "NO\n" : "YES\n");
  }
  return 0;
}
