#include <bits/stdc++.h>
using namespace std;
const int nmax = 100005;
struct query {
  int x, y, timp;
} v[nmax];
int mare[nmax], mic[nmax], rg[nmax], tt[nmax], col[nmax], t[nmax];
pair<int, int> ads[nmax];
vector<pair<int, int> > edg[4 * nmax];
vector<int> ad[nmax];
pair<int, int> E;
int u, edges, bad, n, q, i, nr, j, ind;
bool comp(query unu, query doi) {
  if (unu.x == doi.x && unu.y == doi.y) return unu.timp < doi.timp;
  if (unu.x == doi.x) return unu.y < doi.y;
  return unu.x < doi.x;
}
void add(int nod, int l, int r, int st, int dr, int x, int y) {
  if (st <= l && r <= dr) {
    edg[nod].push_back({x, y});
    return;
  }
  int m = (l + r) / 2;
  if (st <= m) add(2 * nod, l, m, st, dr, x, y);
  if (m < dr) add(2 * nod + 1, m + 1, r, st, dr, x, y);
}
void unite(int A, int B) {
  if (rg[A] > rg[B]) swap(A, B);
  tt[B] = A;
  rg[A] += rg[B];
  ++u;
  mare[u] = A;
  mic[u] = B;
}
void reet(int x) {
  for (int i = 0; i < ad[x].size(); i++)
    if (col[ad[x][i]] == col[x]) {
      col[ad[x][i]] ^= 1;
      reet(ad[x][i]);
    }
}
int finds(int x) {
  while (x != tt[x]) x = tt[x];
  return x;
}
void solve(int nod, int st, int dr) {
  int old = u, oldedges = edges, oldbad = bad, sz = edg[nod].size();
  if (!bad)
    for (int i = 0; i < sz; i++) {
      E = edg[nod][i];
      if (finds(E.first) != finds(E.second)) {
        if (rg[finds(E.first)] > rg[finds(E.second)]) swap(E.first, E.second);
        ad[E.first].push_back(E.second);
        ad[E.second].push_back(E.first);
        ads[++edges] = {E.first, E.second};
        if (col[E.first] == col[E.second]) col[E.first] ^= 1;
        reet(E.first);
        unite(finds(E.first), finds(E.second));
      } else {
        if (col[E.first] == col[E.second]) bad++;
      }
    }
  if (st == dr) {
    if (bad == 0)
      cout << "YES\n";
    else
      cout << "NO\n";
  } else {
    int m = (st + dr) / 2;
    solve(2 * nod, st, m);
    solve(2 * nod + 1, m + 1, dr);
  }
  while (u > old) {
    tt[mic[u]] = mic[u];
    rg[mare[u]] -= rg[mic[u]];
    u--;
  }
  while (edges > oldedges) {
    ad[ads[edges].first].pop_back();
    ad[ads[edges].second].pop_back();
    edges--;
  }
  bad = oldbad;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> q;
  for (i = 1; i <= n; i++) tt[i] = i, rg[i] = 1;
  for (i = 1; i <= q; i++) {
    cin >> v[i].x >> v[i].y;
    v[i].timp = i;
  }
  sort(v + 1, v + q + 1, comp);
  for (i = 1; i <= q; i++) {
    j = i;
    nr = 0;
    while (v[i].x == v[j].x && v[i].y == v[j].y) {
      t[++nr] = v[j].timp;
      j++;
    }
    if (nr % 2) t[++nr] = q + 1;
    for (ind = 1; ind < nr; ind += 2) {
      add(1, 1, q, t[ind], t[ind + 1] - 1, v[i].x, v[i].y);
    }
    j--;
    i = j;
  }
  solve(1, 1, q);
  return 0;
}
