#include <bits/stdc++.h>
using namespace std;
bitset<2 * 2048> mat[2 * 1024];
int n, m;
int a[500000], b[500000];
void debug() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 2 * n; j++) cout << mat[i][j];
    cout << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a[i] >> b[i];
    a[i]--, b[i]--;
    mat[a[i]].set(b[i]);
  }
  for (int i = 0; i < n; i++) mat[i].set(n + i);
  for (int i = 0; i < n; i++) {
    int p = i;
    for (int j = i; j < n; j++)
      if (mat[j][i]) {
        p = j;
        break;
      }
    swap(mat[p], mat[i]);
    for (int j = 0; j < n; j++) {
      if (i != j and mat[j][i]) {
        mat[j] ^= mat[i];
      }
    }
  }
  for (int i = 0; i < m; i++) {
    if (mat[b[i]][a[i] + n]) {
      cout << "NO" << endl;
    } else {
      cout << "YES" << endl;
    }
  }
}
