#include <bits/stdc++.h>
using namespace std;
const int N = 2010;
vector<bitset<N>> getinv(vector<bitset<N>> matrix) {
  const vector<bitset<N>> mmat = matrix;
  const int n = (int)(matrix).size();
  vector<bitset<N>> ans(n, bitset<N>());
  for (int i = 0; i < n; i++) ans[i][i] = 1;
  vector<pair<int, int>> trans;
  int cur = 0;
  for (int i = 0; i < n; i++) {
    int where = -1;
    for (int j = cur; j < n; j++)
      if (matrix[j][i]) where = j;
    assert(where != -1);
    swap(matrix[where], matrix[cur]);
    swap(ans[where], ans[cur]);
    for (int j = 0; j < n; j++)
      if (j != cur && matrix[j][i]) {
        matrix[j] ^= matrix[cur];
        ans[j] ^= ans[cur];
      }
    cur++;
  }
  return ans;
}
void solve(int n) {
  int m;
  cin >> m;
  vector<int> a(m), b(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i] >> b[i];
    --a[i], --b[i];
  }
  vector<bitset<N>> matrix(n);
  for (int i = 0; i < m; i++) matrix[a[i]][b[i]] = 1;
  vector<bitset<N>> iv_tr = getinv(matrix);
  for (int i = 0; i < m; i++)
    if (iv_tr[b[i]][a[i]])
      cout << "NO\n";
    else
      cout << "YES\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long n;
  while (cin >> n) solve(n);
}
