#include <bits/stdc++.h>
using namespace std;
bitset<2048> w[2048];
bitset<2048> a[2048];
int x[500005];
int y[500005];
int n, m;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0, to = m; i < to; ++i) {
    scanf("%d%d", x + i, y + i);
    x[i]--;
    y[i]--;
    w[x[i]][y[i]] = 1;
  }
  for (int i = 0, to = n; i < to; ++i) a[i][i] = 1;
  for (int i = 0, to = n; i < to; ++i) {
    if (!w[i][i]) {
      for (int j = i + 1, to = n; j < to; ++j) {
        if (w[j][i]) {
          swap(w[i], w[j]);
          swap(a[i], a[j]);
          break;
        }
      }
    }
    assert(w[i][i]);
    for (int j = 0, to = n; j < to; ++j)
      if (j != i && w[j][i]) w[j] ^= w[i], a[j] ^= a[i];
  }
  for (int i = 0, to = m; i < to; ++i) {
    puts(a[y[i]][x[i]] ? "NO" : "YES");
  }
  return 0;
}
