#include <bits/stdc++.h>
const int MAXN = 1e5 + 10;
const double eps = 1e-8;
using namespace std;
struct edge {
  int t;
  edge *next;
} e[MAXN << 1], *h[MAXN], *o = e;
void add(int x, int y) {
  o->t = y;
  o->next = h[x];
  h[x] = o++;
}
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x * f;
}
int n, m;
map<pair<int, int>, int> ma;
vector<pair<int, int> > vec[MAXN << 2];
void update(int x, int l, int r, int ql, int qr, pair<int, int> k) {
  if (ql <= l && r <= qr) {
    vec[x].push_back(k);
    return;
  }
  int mid = (l + r) >> 1;
  if (ql <= mid) update(x << 1, l, mid, ql, qr, k);
  if (qr > mid) update(x << 1 | 1, mid + 1, r, ql, qr, k);
}
bool ans[MAXN];
int f[MAXN], key[MAXN], size[MAXN];
pair<int, int> find1(int x) {
  if (x == f[x]) {
    return make_pair(x, key[x]);
  } else {
    pair<int, int> t1 = find1(f[x]);
    return make_pair(t1.first, (t1.second ^ key[x]));
  }
}
void solve(int x, int l, int r, int p) {
  vector<pair<int, int> > del;
  int sum = p;
  for (int i = 0; i < vec[x].size(); i++) {
    int x1 = vec[x][i].first;
    int x2 = vec[x][i].second;
    pair<int, int> t1 = find1(x1);
    pair<int, int> t2 = find1(x2);
    if (t1.first == t2.first) {
      sum &= ((t1.second ^ t2.second));
    } else {
      x1 = t1.first;
      x2 = t2.first;
      if (size[x1] > size[x2]) swap(x1, x2);
      del.push_back(make_pair(x1, x2));
      f[x1] = x2;
      size[x2] += size[x1];
      if (t1.second == t2.second)
        key[x1] = 1;
      else
        key[x1] = 0;
    }
  }
  if (l == r) {
    reverse(del.begin(), del.end());
    for (int i = 0; i < del.size(); i++) {
      f[del[i].first] = del[i].first;
      size[del[i].second] -= size[del[i].first];
      key[del[i].first] = 1;
    }
    ans[l] = sum;
    return;
  }
  int mid = (l + r) >> 1;
  solve(x << 1, l, mid, sum);
  solve(x << 1 | 1, mid + 1, r, sum);
  reverse(del.begin(), del.end());
  for (int i = 0; i < del.size(); i++) {
    f[del[i].first] = del[i].first;
    size[del[i].second] -= size[del[i].first];
    key[del[i].first] = 1;
  }
  del.clear();
}
map<pair<int, int>, int>::iterator ite;
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= n; i++) f[i] = i, key[i] = 1, size[i] = 1;
  for (int i = 1; i <= m; i++) {
    int x = read();
    int y = read();
    if (x > y) swap(x, y);
    if (ma.find(make_pair(x, y)) == ma.end()) {
      ma[make_pair(x, y)] = i;
    } else {
      int t = ma[make_pair(x, y)];
      update(1, 1, m, t, i - 1, make_pair(x, y));
      ma.erase(make_pair(x, y));
    }
  }
  for (ite = ma.begin(); ite != ma.end(); ite++) {
    update(1, 1, m, ite->second, m, ite->first);
  }
  solve(1, 1, m, 1);
  for (int i = 1; i <= m; i++)
    if (ans[i])
      puts("YES");
    else
      puts("NO");
  return 0;
}
