#include <bits/stdc++.h>
using namespace std;
const int Maxx = 100005, Maxn = 2001, INF = 0x3f3f3f3f, Mod = 1e9 + 7;
inline int read() {
  int res = 0, bj = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') bj |= (ch == '-'), ch = getchar();
  while (ch >= '0' && ch <= '9')
    res = (res << 3) + (res << 1) + (ch ^ 48), ch = getchar();
  return bj ? -res : res;
}
struct node {
  int x, y;
  inline node(int a = 0, int b = 0) { x = a, y = b; }
  inline bool operator<(const node &tp) const {
    return x == tp.x ? y < tp.y : x < tp.x;
  }
} Qx;
map<node, int> mp;
map<node, int>::iterator it;
int Ql, Qr;
vector<node> vc[Maxx << 2];
void Add(int p, int l, int r) {
  if (Ql <= l && r <= Qr)
    vc[p].push_back(Qx);
  else {
    int mid = l + r >> 1;
    if (Ql <= mid) Add(p << 1, l, mid);
    if (Qr > mid) Add(p << 1 | 1, mid + 1, r);
  }
}
namespace Bcj {
int fa[Maxx], sz[Maxx], tot, lf[Maxx];
char ld[Maxx], bj, d[Maxx];
int gf(int x, char &y) {
  while (x != fa[x]) y ^= d[x], x = fa[x];
  return x;
}
inline void Add(int x, int y) {
  static char dx, dy;
  dx = dy = 0;
  if (!bj || (x = gf(x, dx)) == (y = gf(y, dy)))
    bj &= dx ^ dy;
  else {
    if (sz[x] < sz[y]) swap(x, y);
    lf[++tot] = y, ld[tot] = d[y];
    fa[y] = x, sz[x] += sz[y], d[y] = dx ^ dy ^ 1;
  }
}
inline void Undo(const int O) {
  for (int y; tot > O; --tot) {
    y = lf[tot], d[y] = ld[tot];
    sz[fa[y]] -= sz[y], fa[y] = y;
  }
}
inline void Build(int n) {
  for (int i = bj = 1; i <= n; ++i) sz[fa[i] = i] = 1;
}
}  // namespace Bcj
void Solve(int p, int l, int r) {
  int Od = Bcj::tot;
  char b = Bcj::bj;
  for (int i = vc[p].size() - 1; ~i; --i) Bcj::Add(vc[p][i].x, vc[p][i].y);
  if (l == r)
    puts(Bcj::bj ? "YES" : "NO");
  else {
    int mid = l + r >> 1;
    Solve(p << 1, l, mid);
    Solve(p << 1 | 1, mid + 1, r);
  }
  Bcj::Undo(Od), Bcj::bj = b;
}
int main() {
  int n = read(), Q = read();
  for (int i = 1, x, y; i <= Q; ++i) {
    x = read(), y = read();
    if (x > y) swap(x, y);
    if (Ql = mp[Qx = node(x, y)])
      Qr = i - 1, Add(1, 1, Q), mp[node(x, y)] = 0;
    else
      mp[node(x, y)] = i;
  }
  for (it = mp.begin(); it != mp.end(); ++it)
    if (Ql = it->second) Qr = Q, Qx = it->first, Add(1, 1, Q);
  return Bcj::Build(n), Solve(1, 1, Q), 0;
}
