#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
bool upmin(T1 &x, T2 y) {
  if (x <= y) return false;
  x = y;
  return true;
}
const int MAXN = 1 << 17;
const int MAXM = 1 << 17;
const int INF = 0x3f3f3f3f;
int N, M, T, opn, cnt;
struct edge {
  int u, v, s, e;
} e[MAXM];
int it[MAXM], od[MAXM];
pair<int, int> opt[MAXM << 1];
struct node {
  bool rev;
  int val, mn, siz;
  node *lc, *rc, *f;
  node() {
    val = mn = INF;
    siz = 1;
  }
  void tagrev() {
    rev ^= 1;
    swap(lc, rc);
  }
  void update() {
    mn = val, siz = 1;
    if (lc) upmin(mn, lc->mn), siz += lc->siz;
    if (rc) upmin(mn, rc->mn), siz += rc->siz;
  }
  void downdate() {
    if (rev) {
      if (lc) lc->tagrev();
      if (rc) rc->tagrev();
      rev = 0;
    }
  }
  bool isroot() { return !f or f->lc != this and f->rc != this; }
} ndl[MAXN], edl[MAXM];
void rotate(node *x) {
  node *y = x->f, *z = y->f, *b = y->lc == x ? x->rc : x->lc;
  y->f = x, x->f = z;
  if (b) b->f = y;
  if (z) {
    if (z->lc == y)
      z->lc = x;
    else if (z->rc == y)
      z->rc = x;
  }
  if (y->lc == x)
    y->lc = b, x->rc = y;
  else
    y->rc = b, x->lc = y;
  y->update();
}
void splay(node *x) {
  static node *stt[MAXM << 2];
  int stn = 1;
  stt[1] = x;
  for (node *i = x; not i->isroot(); i = i->f) stt[++stn] = i->f;
  while (stn) stt[stn--]->downdate();
  while (not x->isroot()) {
    if (x->f->isroot())
      rotate(x);
    else if ((x->f->f->lc == x->f) == (x->f->lc == x))
      rotate(x->f), rotate(x);
    else
      rotate(x), rotate(x);
  }
  x->update();
}
void access(node *x) {
  for (node *p = x, *q = NULL; p; q = p, p = p->f) {
    splay(p);
    p->rc = q;
    p->update();
  }
}
node *findroot(node *x) {
  access(x);
  splay(x);
  while (x->downdate(), x->lc) x = x->lc;
  splay(x);
  return x;
}
void makeroot(node *x) {
  access(x);
  splay(x);
  x->tagrev();
}
void link(node *x, node *y) {
  makeroot(x), makeroot(y);
  x->f = y;
}
void cut(node *x, node *y) {
  makeroot(x), access(y);
  splay(y);
  y->lc = x->f = NULL;
  y->update();
}
void link(int i) {
  link(edl + i, ndl + e[i].u);
  link(edl + i, ndl + e[i].v);
  it[i] = 1;
}
void cut(int i) {
  cut(edl + i, ndl + e[i].u);
  cut(edl + i, ndl + e[i].v);
  it[i] = 0;
}
node *getmin(node *x) {
  int t = x->mn;
  while (x->val != t) {
    x->downdate();
    if (x->lc and x->lc->mn == t)
      x = x->lc;
    else
      x = x->rc;
  }
  splay(x);
  return x;
}
void addedge(const edge &e, int i) {
  if (findroot(ndl + e.u) != findroot(ndl + e.v)) return link(i), void();
  node *x = ndl + e.u, *y = ndl + e.v, *z;
  makeroot(x);
  access(y);
  splay(y);
  z = getmin(y);
  int sz = z->siz;
  if (e.e > z->val) {
    int j = z - edl;
    cut(j);
    if (not((sz >> 1) & 1)) cnt += od[j] = 1;
    link(i);
  } else if (not((sz >> 1) & 1))
    cnt += od[i] = 1;
}
void deledge(int i) {
  if (it[i]) return cut(i), void();
  if (od[i]) cnt--, od[i] = 0;
}
signed main() {
  cin >> N >> M;
  T = M;
  {
    static int U[MAXM], V[MAXM];
    for (int i = 1; i <= M; ++i) {
      cin >> U[i] >> V[i];
      if (U[i] > V[i]) swap(U[i], V[i]);
    }
    int m = 0;
    map<pair<int, int>, int> mp;
    for (int i = 1; i <= M; ++i) {
      if (mp.count(make_pair(U[i], V[i]))) {
        int p = mp[make_pair(U[i], V[i])];
        ++m;
        e[m].u = U[i], e[m].v = V[i], e[m].s = p, e[m].e = i - 1;
        edl[m].val = edl[m].mn = e[m].e, edl[m].siz = 1;
        opt[++opn] = make_pair(e[m].s, m);
        opt[++opn] = make_pair(e[m].e, m);
        mp.erase(make_pair(U[i], V[i]));
      } else {
        mp[make_pair(U[i], V[i])] = i - 1;
      }
    }
    for (auto it = mp.begin(); it != mp.end(); ++it) {
      int u, v;
      tie(u, v) = it->first;
      int p = it->second;
      ++m;
      e[m].u = u, e[m].v = v, e[m].s = p, e[m].e = T;
      edl[m].val = edl[m].mn = e[m].e, edl[m].siz = 1;
      opt[++opn] = make_pair(e[m].s, m);
      opt[++opn] = make_pair(e[m].e, m);
    }
    M = m;
  }
  sort(opt + 1, opt + opn + 1);
  for (int i = 1, p = 1, t, w; i <= T; ++i) {
    for (; p <= opn and (t = opt[p].first) < i; ++p) {
      w = opt[p].second;
      if (t == e[w].s)
        addedge(e[w], w);
      else
        deledge(w);
    }
    cout << (cnt ? "NO" : "YES") << "\n";
  }
  return 0;
}
