#include <bits/stdc++.h>
using namespace std;
inline int gi() {
  char c;
  int num = 0, flg = 1;
  while ((c = getchar()) < '0' || c > '9')
    if (c == '-') flg = -1;
  while (c >= '0' && c <= '9') {
    num = num * 10 + c - 48;
    c = getchar();
  }
  return num * flg;
}
map<pair<int, int>, int> mp;
map<pair<int, int>, int>::iterator it;
struct node {
  int l, r;
  vector<pair<int, int> > x;
} a[100005 << 2];
void build(int i, int l, int r) {
  a[i].l = l;
  a[i].r = r;
  if (l == r) return;
  int mid = (l + r) >> 1;
  build(i << 1, l, mid);
  build(i << 1 | 1, mid + 1, r);
}
void insert(int i, int l, int r, pair<int, int> k) {
  if (a[i].l > r || a[i].r < l) return;
  if (l <= a[i].l && a[i].r <= r) {
    a[i].x.push_back(k);
    return;
  }
  insert(i << 1, l, r, k);
  insert(i << 1 | 1, l, r, k);
}
bool ans[100005];
int fa[100005], H[100005], dis[100005];
int stk[100005], top;
int find(int x) {
  while (x != fa[x]) x = fa[x];
  return x;
}
bool getdis(int x) {
  bool ret = 0;
  while (x != fa[x]) ret ^= dis[x], x = fa[x];
  return ret;
}
void back(int tmptop) {
  while (top > tmptop) {
    if (stk[top] < 0)
      H[-stk[top]]--;
    else
      fa[stk[top]] = stk[top], dis[stk[top]] = 0;
    top--;
  }
}
void solve(int i, bool flg) {
  int tmptop = top;
  for (int j = 0; j < (int)a[i].x.size(); j++) {
    int u = a[i].x[j].first, v = a[i].x[j].second;
    int p = find(u), q = find(v);
    bool w = getdis(u) ^ getdis(v) ^ 1;
    if (p == q)
      flg |= w;
    else {
      if (H[p] < H[q]) swap(p, q);
      fa[q] = p;
      dis[q] = w;
      stk[++top] = q;
      if (H[p] == H[q]) stk[++top] = -p;
    }
  }
  if (a[i].l == a[i].r) {
    ans[a[i].l] = flg;
    back(tmptop);
    return;
  }
  solve(i << 1, flg);
  solve(i << 1 | 1, flg);
  back(tmptop);
}
int main() {
  int n, Q, i, u, v;
  n = gi();
  Q = gi();
  build(1, 1, Q);
  for (i = 1; i <= Q; i++) {
    u = gi();
    v = gi();
    if (u > v) swap(u, v);
    pair<int, int> tmp = make_pair(u, v);
    int &pp = mp[tmp];
    if (pp == 0)
      pp = i;
    else {
      insert(1, pp, i - 1, tmp);
      pp = 0;
    }
  }
  for (it = mp.begin(); it != mp.end(); it++)
    if (it->second) {
      insert(1, it->second, Q, it->first);
    }
  for (i = 1; i <= n; i++) fa[i] = i, H[i] = 1;
  solve(1, 0);
  for (i = 1; i <= Q; i++) {
    if (!ans[i])
      printf("YES\n");
    else
      printf("NO\n");
  }
}
