#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
string to_string(string s) { return '"' + s + '"'; }
string to_string(char s) { return string(1, s); }
string to_string(const char *s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A>
string to_string(A);
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool f = 1;
  string r = "{";
  for (const auto &x : v) {
    if (!f) r += ", ";
    f = 0;
    r += to_string(x);
  }
  return r + "}";
}
void debug_out() { cout << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cout << " " << to_string(H);
  debug_out(T...);
}
inline int add(int a, int b) {
  a += b;
  if (a >= MOD) a -= MOD;
  return a;
}
inline int sub(int a, int b) {
  a -= b;
  if (a < 0) a += MOD;
  return a;
}
inline int mul(int a, int b) { return (int)((long long)a * b % MOD); }
inline int binpow(int a, int b) {
  int res = 1;
  while (b > 0) {
    if (b & 1) res = mul(res, a);
    a = mul(a, a);
    b /= 2;
  }
  return res;
}
inline int inv(int a) { return binpow(a, MOD - 2); }
int gcd(int a, int b, int &x, int &y) {
  if (a == 0) {
    x = 0, y = 1;
    return b;
  }
  int x1, y1;
  int d = gcd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
const int N = 1e5 + 5;
namespace DCT {
struct Edge {
  int l, r, x, y;
};
struct DynamicDSU {
  vector<int> p, sz, parity;
  stack<int> st, notBP;
  DynamicDSU(int n) {
    parity = p = sz = vector<int>(n);
    st.push(-1);
    notBP.push(0);
    for (int i = 0; i < n; ++i) p[i] = i, sz[i] = 1;
  }
  inline pair<int, int> root(int x) {
    int d = 0;
    while (x != p[x]) d ^= parity[x], x = p[x];
    return {p[x], d};
  }
  inline void merge(int x, int y) {
    auto px = root(x), py = root(y);
    x = px.first, y = py.first;
    if (x == y) {
      if (px.second == py.second) {
        st.push(x);
        notBP.push(1);
      }
      return;
    }
    if (sz[x] < sz[y]) swap(x, y);
    p[y] = x;
    sz[x] += sz[y];
    parity[y] = px.second ^ py.second ^ 1;
    st.push(y);
    notBP.push(notBP.top());
  }
  inline void rollback() {
    int y = st.top(), x = p[y];
    st.pop();
    notBP.pop();
    if (y == x) return;
    sz[x] -= sz[y];
    p[y] = y;
    parity[y] = 1;
  }
  void rollback(int upto) {
    while (st.size() > upto) rollback();
  }
} dsu(N);
map<pair<int, int>, int> mp;
vector<Edge> edge;
vector<pair<int, int> > t[N];
int tym = 0, ans[N];
inline void addEdge(int x, int y, bool op = true) {
  if (x > y) swap(x, y);
  if (op && mp.count({x, y})) return;
  if (!op && !mp.count({x, y})) return;
  if (op)
    mp[{x, y}] = ++tym;
  else {
    edge.push_back((Edge){mp[{x, y}], (++tym) - 1, x, y});
    mp.erase({x, y});
  }
}
void addRemainingEdges() {
  ++tym;
  for (auto p : mp) {
    int x = p.first.first, y = p.first.second, i = p.second;
    edge.push_back((Edge){i, tym - 1, x, y});
  }
}
void go(int l, int r, vector<Edge> allEdge) {
  int now = dsu.st.size();
  vector<Edge> down;
  for (auto e : allEdge) {
    if (l > e.r || r < e.l) {
    } else if (l >= e.l && r <= e.r)
      dsu.merge(e.x, e.y);
    else
      down.push_back(e);
  }
  if (l == r) {
    ans[l] = !dsu.notBP.top();
  } else {
    int m = (l + r) / 2;
    go(l, m, down);
    go(m + 1, r, down);
  }
  dsu.rollback(now);
}
void solve() {
  addRemainingEdges();
  go(0, tym, edge);
}
};  // namespace DCT
using namespace DCT;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, q;
  cin >> n >> q;
  set<pair<int, int> > s;
  for (int i = 0; i < q; ++i) {
    int x, y;
    cin >> x >> y;
    if (!s.count({x, y}))
      addEdge(x, y, true), s.insert({x, y});
    else
      addEdge(x, y, false), s.erase({x, y});
  }
  DCT::solve();
  for (int i = 1; i <= q; ++i) ans[i] ? cout << "YES\n" : cout << "NO\n";
  return 0;
}
