#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
pii query[500010];
bitset<2100 * 2> p[2100];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    scanf("%d %d", &query[i].first, &query[i].second);
    query[i].first--;
    query[i].second--;
    p[query[i].first].set(query[i].second);
  }
  for (int i = 0; i < n; i++) p[i].set(i + n);
  for (int i = 0; i < n; i++) {
    if (p[i][i] == 0) {
      for (int j = i + 1; j < n; j++)
        if (p[j][i]) {
          swap(p[j], p[i]);
          break;
        }
    }
    for (int j = 0; j < n; j++)
      if (p[j][i] and i != j) {
        p[j] ^= p[i];
      }
  }
  for (int i = 1; i <= m; i++) {
    if (p[query[i].second][query[i].first + n])
      puts("NO");
    else
      puts("YES");
  }
  return 0;
}
