#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int N = int(2e3) + 10;
const int M = int(5e5) + 10;
bitset<N> A[N], B[N];
int X[M], Y[M];
int main() {
  int n;
  scanf("%d", &n);
  int m;
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d", &x);
    scanf("%d", &y);
    x--;
    y--;
    A[x][y] = 1;
    X[i] = x;
    Y[i] = y;
  }
  for (int i = 0; i < n; i++) B[i][i] = 1;
  for (int i = 0; i < n; i++) {
    int idx = -1;
    for (int j = i; j < n; j++)
      if (A[j][i] == 1) {
        idx = j;
        break;
      }
    assert(idx >= 0);
    swap(A[idx], A[i]);
    swap(B[idx], B[i]);
    for (int j = 0; j < n; j++)
      if (j != i && A[j][i] == 1) {
        A[j] ^= A[i];
        B[j] ^= B[i];
      }
  }
  for (int i = 0; i < m; i++) puts(!B[Y[i]][X[i]] ? "YES" : "NO");
  return 0;
}
