#include <bits/stdc++.h>
using namespace std;
const int NMAX = 2005;
int n, m;
bitset<2 * NMAX> a[NMAX];
void Print() {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cout << a[i][j] << " ";
    }
    cout << '\n';
  }
  cout << '\n';
}
void FindInverse() {
  for (int i = 1; i <= n; i++) {
    if (!a[i][i]) {
      for (int k = i + 1; k <= n; k++) {
        if (a[k][i]) {
          a[i] ^= a[k];
          break;
        }
      }
    }
    for (int k = i + 1; k <= n; k++) {
      if (a[k][i]) {
        a[k] ^= a[i];
      }
    }
  }
  for (int i = n; i >= 1; i--) {
    for (int k = i - 1; k >= 1; k--) {
      if (a[k][i]) {
        a[k] ^= a[i];
      }
    }
  }
}
int main() {
  cin.sync_with_stdio(false);
  cin >> n >> m;
  vector<pair<int, int> > v;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    v.emplace_back(x, y);
    a[x][y] = 1;
  }
  for (int i = 1; i <= n; i++) {
    a[i][n + i] = 1;
  }
  FindInverse();
  for (auto it : v) {
    cout << (!a[it.second][it.first + n] ? "YES" : "NO") << '\n';
  }
  return 0;
}
