#include <bits/stdc++.h>
const int MAXN = 100000;
int N, Q, Ans[MAXN + 5];
struct DSU {
  struct Node {
    int fa, col, siz;
  } P[MAXN + 5];
  void Init() {
    for (int i = 1; i <= N; i++) P[i] = (Node){i, 0, 1};
  }
  Node Find(int x) {
    if (P[x].fa == x) return P[x];
    Node tmp = Find(P[x].fa);
    return (Node){tmp.fa, tmp.col ^ P[x].col, tmp.siz};
  }
  int Union(int x, int y, std::stack<std::pair<int, int> > &S) {
    Node u = Find(x), v = Find(y);
    if (u.fa == v.fa) return u.col != v.col;
    if (u.siz < v.siz) std::swap(u, v);
    x = u.fa, y = v.fa;
    P[y].fa = x;
    P[x].siz += P[y].siz;
    P[y].col = u.col ^ v.col ^ 1;
    S.push(std::make_pair(x, y));
    return 1;
  }
  void Back(int x, int y) {
    P[x].siz -= P[y].siz;
    P[y].fa = y, P[y].col = 0;
  }
} D;
struct SegmentTree {
  std::vector<std::pair<int, int> > Tag[MAXN * 4 + 5];
  void Insert(int i, int l, int r, int lft, int rgt, std::pair<int, int> e) {
    if (lft <= l && r <= rgt) {
      Tag[i].push_back(e);
      return;
    }
    int mid = (l + r) >> 1;
    if (lft <= mid) Insert((i << 1), l, mid, lft, rgt, e);
    if (rgt >= mid + 1) Insert((i << 1 | 1), mid + 1, r, lft, rgt, e);
  }
  void Dfs(int i, int l, int r, int cur) {
    std::stack<std::pair<int, int> > S;
    if (cur)
      for (int j = 0; j < int(Tag[i].size()); j++)
        cur &= D.Union(Tag[i][j].first, Tag[i][j].second, S);
    if (l == r)
      Ans[l] = cur;
    else {
      int mid = (l + r) >> 1;
      Dfs((i << 1), l, mid, cur);
      Dfs((i << 1 | 1), mid + 1, r, cur);
    }
    while (!S.empty()) {
      D.Back(S.top().first, S.top().second), S.pop();
    }
  }
} T;
std::map<std::pair<int, int>, int> Vis;
int main() {
  scanf("%d%d", &N, &Q);
  for (int i = 1; i <= Q; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    std::pair<int, int> E(std::min(u, v), std::max(u, v));
    if (Vis[E]) {
      T.Insert(1, 1, Q, Vis[E], i - 1, E);
      Vis[E] = 0;
    } else
      Vis[E] = i;
  }
  for (std::map<std::pair<int, int>, int>::iterator it = Vis.begin();
       it != Vis.end(); ++it)
    if (it->second) T.Insert(1, 1, Q, it->second, Q, it->first);
  D.Init();
  T.Dfs(1, 1, Q, 1);
  for (int i = 1; i <= Q; i++) puts(Ans[i] ? "YES" : "NO");
  return 0;
}
