#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T& x) {
  char c;
  bool fu = 0;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  if (c == '-') fu = 1, c = getchar();
  for (x = 0; c > 32; c = getchar()) x = x * 10 + c - '0';
  if (fu) x *= -1;
}
template <class T>
inline void read(T& x, T& y) {
  read(x);
  read(y);
}
template <class T>
inline void read(T& x, T& y, T& z) {
  read(x, y);
  read(z);
}
const int N = 2222, M = 555555;
int n, m, x[M], y[M];
bitset<N> a[N], b[N];
int main() {
  read(n, m);
  for (int _tmp = m, i = 1; i <= _tmp; ++i) read(x[i], y[i]), a[x[i]][y[i]] = 1;
  for (int _tmp = n, i = 1; i <= _tmp; ++i) b[i][i] = 1;
  for (int _tmp = n, i = 1; i <= _tmp; ++i) {
    int ps = i;
    while (!a[ps][i]) ++ps;
    swap(a[ps], a[i]);
    swap(b[ps], b[i]);
    for (int _tmp = n, j = 1; j <= _tmp; ++j)
      if (i != j && a[j][i]) a[j] ^= a[i], b[j] ^= b[i];
  }
  for (int _tmp = m, i = 1; i <= _tmp; ++i) puts(!b[y[i]][x[i]] ? "YES" : "NO");
  return 0;
}
