#include <bits/stdc++.h>
using namespace std;
int IN() {
  int x = 0, f = 0, ch;
  for (; (ch = getchar()) < '0' || ch > '9';) f = (ch == '-');
  for (; ch >= '0' && ch <= '9'; (ch = getchar())) x = x * 10 + ch - '0';
  return f ? -x : x;
}
int N, M, X[500005], Y[500005];
bitset<2005> A[2005], B[2005];
int main(int argc, char* argv[]) {
  N = IN();
  M = IN();
  for (int i = 1, lim = M; i <= lim; i++) {
    X[i] = IN();
    Y[i] = IN();
    A[X[i]][Y[i]] = 1;
  }
  for (int i = 1, lim = N; i <= lim; i++) B[i][i] = 1;
  for (int i = 1, lim = N; i <= lim; i++) {
    int j = i;
    for (; !A[j][i]; j++)
      ;
    swap(A[i], A[j]);
    swap(B[i], B[j]);
    for (int j = 1, lim = N; j <= lim; j++)
      if (j != i && A[j][i]) A[j] ^= A[i], B[j] ^= B[i];
  }
  for (int i = 1, lim = M; i <= lim; i++) {
    if (B[Y[i]][X[i]])
      puts("NO");
    else
      puts("YES");
  }
  return 0;
}
