#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y;
};
struct rlt {
  int fa, rel;
};
struct meg {
  int x, y, t;
} a[100005];
vector<node> d[100005 << 2], e[100005 << 2];
int f[100005], g[100005], siz[100005], ans[100005];
int n, m;
inline int read() {
  int n = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    n = n * 10 + c - '0';
    c = getchar();
  }
  return n * f;
}
rlt getrel(int x) {
  if (!f[x]) return (rlt){x, 0};
  rlt lt = getrel(f[x]);
  return (rlt){lt.fa, lt.rel ^ g[x]};
}
void getins(int x, int L, int R, int ql, int qr, int yl, int yr) {
  if (ql == L && qr == R) {
    e[x].push_back((node){yl, yr});
    return;
  }
  int mid = L + R >> 1;
  if (qr <= mid)
    getins((x << 1), L, mid, ql, qr, yl, yr);
  else if (ql > mid)
    getins((x << 1 | 1), mid + 1, R, ql, qr, yl, yr);
  else
    getins((x << 1), L, mid, ql, mid, yl, yr),
        getins((x << 1 | 1), mid + 1, R, mid + 1, qr, yl, yr);
}
void dfs(int x, int L, int R, int u) {
  register int i;
  rlt xf, yf;
  for (i = 0; i < e[x].size(); ++i) {
    xf = getrel(e[x][i].x);
    yf = getrel(e[x][i].y);
    if (xf.fa == yf.fa) {
      if (xf.rel == yf.rel) u |= 1;
    } else {
      if (siz[xf.fa] < siz[yf.fa]) swap(xf, yf);
      siz[xf.fa] += siz[yf.fa];
      f[yf.fa] = xf.fa;
      g[yf.fa] = xf.rel ^ yf.rel ^ 1;
      d[x].push_back((node){xf.fa, yf.fa});
    }
  }
  if (L == R)
    ans[L] = u;
  else {
    int mid = L + R >> 1;
    dfs((x << 1), L, mid, u);
    dfs((x << 1 | 1), mid + 1, R, u);
  }
  for (i = d[x].size() - 1; i >= 0; --i) {
    siz[d[x][i].x] -= siz[d[x][i].y];
    f[d[x][i].y] = g[d[x][i].y] = 0;
  }
}
bool cmp(const meg& a, const meg& b) {
  if (a.x != b.x) return a.x < b.x;
  if (a.y != b.y) return a.y < b.y;
  return a.t < b.t;
}
int main() {
  register int i;
  n = read();
  m = read();
  for (i = 1; i <= m; ++i) a[i].x = read(), a[i].y = read(), a[i].t = i;
  sort(a + 1, a + m + 1, cmp);
  for (i = 1; i <= m;)
    if (a[i].x == a[i + 1].x && a[i].y == a[i + 1].y)
      getins(1, 1, m, a[i].t, a[i + 1].t - 1, a[i].x, a[i].y), i += 2;
    else
      getins(1, 1, m, a[i].t, m, a[i].x, a[i].y), ++i;
  for (i = 1; i <= n; ++i) siz[i] = 1;
  dfs(1, 1, m, 0);
  for (i = 1; i <= m; ++i) puts(ans[i] ? "NO" : "YES");
}
