#include <bits/stdc++.h>
using namespace std;
int n, m, ok = 1;
int f[100005], sz[100005], val[100005];
vector<pair<int, int> > ve[400005];
map<int, int> s[100005];
void insert(int p, const pair<int, int> &e, int l, int r, int L, int R) {
  if (L >= l && R <= r) return ve[p].push_back(e), void();
  const int mid = L + R >> 1;
  if (l <= mid) insert(p << 1, e, l, r, L, mid);
  if (r > mid) insert(p << 1 | 1, e, l, r, mid + 1, R);
}
inline int find(int x) {
  while (x ^ f[x]) x = f[x];
  return x;
}
inline bool query(int x) {
  bool v = 0;
  while (x ^ f[x]) v ^= val[x], x = f[x];
  return v;
}
void solve(int p, int l, int r) {
  vector<pair<int *, int> > g;
  g.push_back(make_pair(&ok, ok));
  for (auto &e : ve[p]) {
    int x = e.first, y = e.second, fx = find(x), fy = find(y);
    if (fx == fy) {
      if (query(x) ^ query(y) ^ 1) ok = 0;
    } else {
      g.push_back(make_pair(&f[fx], f[fx]));
      g.push_back(make_pair(&f[fy], f[fy]));
      g.push_back(make_pair(&sz[fx], sz[fx]));
      g.push_back(make_pair(&sz[fy], sz[fy]));
      if (sz[fx] > sz[fy])
        sz[fx] += sz[fy], val[fy] = query(x) ^ query(y) ^ 1, f[fy] = fx;
      else
        sz[fy] += sz[fx], val[fx] = query(x) ^ query(y) ^ 1, f[fx] = fy;
    }
  }
  if (l == r)
    puts(ok ? "YES" : "NO");
  else {
    const int mid = l + r >> 1;
    solve(p << 1, l, mid);
    solve(p << 1 | 1, mid + 1, r);
  }
  for (auto t : g) *t.first = t.second;
}
inline int read(register int x = 0, register char ch = getchar(),
                register int f = 0) {
  for (; !isdigit(ch); ch = getchar()) f = ch == '-';
  for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + (ch ^ 48);
  return f ? -x : x;
}
int main() {
  n = read();
  m = read();
  for (int i = 1, x, y; i <= m; ++i) {
    x = read();
    y = read();
    if (x > y) swap(x, y);
    if (s[x].find(y) != s[x].end())
      insert(1, make_pair(x, y), s[x][y], i - 1, 1, m), s[x].erase(y);
    else
      s[x][y] = i;
  }
  for (int i = 1; i <= n; ++i)
    for (auto t : s[i]) insert(1, make_pair(i, t.first), t.second, m, 1, m);
  for (int i = 1; i <= n; ++i) f[i] = i, sz[i] = 1;
  solve(1, 1, m);
  return 0;
}
