#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cout.precision(9);
  cout << fixed;
  int n, m;
  cin >> n >> m;
  vector<int> xx(m);
  vector<int> yy(m);
  for (int i = 0; i < m; ++i) {
    cin >> xx[i] >> yy[i];
    --xx[i], --yy[i];
  }
  std::string ans;
  vector<bitset<2000>> a(n);
  vector<bitset<2000>> inv(n);
  for (int i = 0; i < m; ++i) a[xx[i]][yy[i]] = 1;
  for (int i = 0; i < n; ++i) inv[i][i] = 1;
  for (int i = 0; i < n; ++i) {
    if (a[i][i] != 1) {
      for (int j = i + 1; j < n; ++j) {
        if (a[j][i]) {
          swap(a[i], a[j]);
          swap(inv[i], inv[j]);
          break;
        }
        if (j == n - 1) {
          while (true)
            ;
        }
      }
    }
    for (int j = i + 1; j < n; ++j) {
      if (a[j][i]) {
        a[j] ^= a[i];
        inv[j] ^= inv[i];
      }
    }
  }
  for (int i = n - 1; i >= 0; --i) {
    for (int j = i - 1; j >= 0; --j) {
      if (a[j][i]) {
        a[j] ^= a[i];
        inv[j] ^= inv[i];
      }
    }
  }
  for (int i = 0; i < m; ++i) {
    if (inv[yy[i]][xx[i]])
      ans += "NO\n";
    else
      ans += "YES\n";
  }
  cout << ans;
  return 0;
}
