You are given an undirected graph consisting of n vertices. Initially there are no edges in the graph. Also you are given q queries, each query either adds one undirected edge to the graph or removes it. After each query you have to check if the resulting graph is bipartite (that is, you can paint all vertices of the graph into two colors so that there is no edge connecting two vertices of the same color).

Input

The first line contains two integers n and q (2 ≤ n, q ≤ 100000).

Then q lines follow. ith line contains two numbers xi and yi (1 ≤ xi < yi ≤ n). These numbers describe ith query: if there is an edge between vertices xi and yi, then remove it, otherwise add it.

Output

Print q lines. ith line must contain YES if the graph is bipartite after ith query, and NO otherwise.

Example

Input

3 5
2 3
1 3
1 2
1 2
1 2


Output

YES
YES
NO
YES
NO
#include <bits/stdc++.h>
using namespace std;
void trace_() { cerr << "\n"; }
template <typename T1, typename... T2>
void trace_(T1 t1, T2... t2) {
  cerr << ' ' << t1;
  trace_(t2...);
}
const long long mxN = 1e5 + 5;
long long n, q;
vector<long long> seg[mxN * 4];
void add(long long a, long long b, long long v, long long id = 1,
         long long l = 1, long long r = q) {
  if (a <= l and r <= b) {
    seg[id].emplace_back(v);
    return;
  }
  long long mid = (l + r) >> 1;
  if (a <= mid) add(a, b, v, (id << 1), l, mid);
  if (b > mid) add(a, b, v, ((id << 1) | 1), mid + 1, r);
}
long long dsu[mxN], sz[mxN], dis[mxN];
void init() {
  for (long long i = 1; i <= n; i++) dsu[i] = i, sz[i] = 1;
}
inline pair<long long, long long> get(long long x) {
  long long d = 0;
  while (dsu[x] != x) {
    d ^= dis[x];
    x = dsu[x];
  }
  return {x, d};
}
inline void roll_back(vector<pair<long long, long long> > &v) {
  while (!v.empty()) {
    auto [x, y] = v.back();
    v.pop_back();
    dsu[x] = x;
    sz[y] -= sz[x];
    dis[x] = 0;
  }
}
void dfs(long long ok = 1, long long id = 1, long long l = 1, long long r = q) {
  vector<pair<long long, long long> > v;
  if (ok) {
    for (long long i : seg[id]) {
      long long x = i % (n + 1), y = i / (n + 1);
      auto [fx, dx] = get(x);
      auto [fy, dy] = get(y);
      if (fx == fy and dx == dy) {
        ok = 0;
        break;
      } else if (fx == fy) {
        continue;
      } else {
        if (sz[fx] > sz[fy]) swap(fx, fy);
        dis[fx] = dx ^ dy ^ 1;
        dsu[fx] = fy;
        sz[fy] += sz[fx];
        v.emplace_back(fx, fy);
      }
    }
  }
  if (l == r) {
    cout << (ok ? "YES\n" : "NO\n");
    roll_back(v);
    return;
  }
  long long mid = (l + r) >> 1;
  dfs(ok, (id << 1), l, mid);
  dfs(ok, ((id << 1) | 1), mid + 1, r);
  roll_back(v);
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  cin >> n >> q;
  init();
  map<long long, long long> mp;
  for (long long i = 1; i <= q; i++) {
    long long a, b;
    cin >> a >> b;
    long long t = a * (n + 1) + b;
    if (mp.count(t)) {
      add(mp[t], i - 1, t);
      mp.erase(t);
    } else
      mp[t] = i;
  }
  for (pair<long long, long long> i : mp) {
    add(i.second, q, i.first);
  }
  dfs(1);
}
