#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
const int MAXM = MAXN << 1;
const int MAXTSIZE = 1 << 18;
vector<pair<int, int> > tr[MAXTSIZE];
map<pair<int, int>, int> mp;
vector<vector<pair<int *, int> > > history;
bool ans[MAXN];
int fa[MAXM], sz[MAXM];
int n, qn;
int DSU_GetFather(int x) {
  while (x != fa[x]) x = fa[x];
  return x;
}
void Assign(int &x, int y) {
  history.back().push_back(make_pair(&x, x));
  x = y;
  return;
}
void Rollback() {
  reverse(history.back().begin(), history.back().end());
  for (auto &p : history.back()) *(p.first) = p.second;
  history.pop_back();
  return;
}
void DSU_Merge(int x, int y) {
  int rx = DSU_GetFather(x);
  int ry = DSU_GetFather(y);
  if (sz[rx] > sz[ry]) swap(rx, ry);
  Assign(fa[rx], ry);
  Assign(sz[ry], sz[ry] + sz[rx]);
  return;
}
void ST_Add(int u, int l, int r, const int &ql, const int &qr,
            const pair<int, int> &val) {
  int mid = l + r >> 1;
  if (ql <= l && r <= qr)
    tr[u].push_back(val);
  else {
    if (ql <= mid) ST_Add(u << 1, l, mid, ql, qr, val);
    if (qr > mid) ST_Add(u << 1 | 1, mid + 1, r, ql, qr, val);
  }
  return;
}
void DFS(int u, int l, int r) {
  int mid = l + r >> 1;
  history.push_back({});
  for (auto &p : tr[u]) {
    DSU_Merge(p.first + n, p.second);
    DSU_Merge(p.first, p.second + n);
    if (DSU_GetFather(p.first + n) == DSU_GetFather(p.first) ||
        DSU_GetFather(p.second + n) == DSU_GetFather(p.second)) {
      Rollback();
      return;
    }
  }
  if (l == r)
    ans[r] = true;
  else {
    DFS(u << 1, l, mid);
    DFS(u << 1 | 1, mid + 1, r);
  }
  Rollback();
  return;
}
int main() {
  scanf("%d%d", &n, &qn);
  for (int i = 1; i <= n * 2; ++i) fa[i] = i;
  for (int i = 0; i < qn; ++i) {
    pair<int, int> p;
    map<pair<int, int>, int>::iterator it;
    scanf("%d%d", &p.first, &p.second);
    if ((it = mp.find(p)) != mp.end())
      ST_Add(1, 0, qn - 1, it->second, i - 1, p), mp.erase(it);
    else
      mp[p] = i;
  }
  for (auto &p : mp) ST_Add(1, 0, qn - 1, p.second, qn - 1, p.first);
  DFS(1, 0, qn - 1);
  for (int i = 0; i < qn; ++i) printf("%s\n", ans[i] ? "YES" : "NO");
  return 0;
}
