#include <bits/stdc++.h>
using namespace std;
int n, m;
bitset<4020> a[4020];
pair<int, int> vp[500005];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    cin >> vp[i].first >> vp[i].second;
    a[vp[i].first][vp[i].second] = 1;
  }
  for (int i = 1; i <= n; ++i) a[i][n + i] = 1;
  for (int i = 1; i <= n; ++i) {
    int j;
    for (j = i; !a[j].test(i); ++j)
      ;
    swap(a[i], a[j]);
    for (int j = i + 1; j <= n; ++j) {
      if (a[j].test(i)) {
        a[j] ^= a[i];
      }
    }
  }
  for (int i = n; i >= 1; --i) {
    for (int j = i + 1; j <= n; ++j) {
      if (a[i].test(j)) {
        a[i] ^= a[j];
      }
    }
  }
  for (int i = 1; i <= m; ++i) {
    printf("%s\n", a[vp[i].second][vp[i].first + n] ? "NO" : "YES");
  }
  return 0;
}
