#include <bits/stdc++.h>
using namespace std;
string itos(int x) {
  stringstream ss;
  ss << x;
  return ss.str();
}
int n, m, taken[2010];
bitset<2010> a[2010], b[2010];
pair<int, int> f[500010];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> f[i].first >> f[i].second;
    a[--f[i].first][--f[i].second] = 1;
  }
  for (int i = 0; i < n; i++) b[i][i] = 1;
  fill(taken, taken + 2010, -1);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[i][j]) {
        if (taken[j] == -1) {
          taken[j] = i;
          break;
        } else {
          a[i] ^= a[taken[j]];
          b[i] ^= b[taken[j]];
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    int now = taken[i];
    for (int j = i + 1; j < n; j++) {
      if (a[now][j]) {
        a[now] ^= a[taken[j]];
        b[now] ^= b[taken[j]];
      }
    }
  }
  for (int i = 0; i < m; i++)
    cout << (b[taken[f[i].second]][f[i].first] ? "NO" : "YES") << endl;
  return 0;
}
