#include <bits/stdc++.h>
using namespace std;
const int MAX = 2000;
bitset<MAX> b[MAX], c[MAX];
int g[MAX], who[MAX];
int u[500005], v[500005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> u[i] >> v[i];
    u[i]--;
    v[i]--;
    b[u[i]][v[i]] = 1;
  }
  for (int i = 0; i < n; i++) c[i][i] = 1;
  for (int i = 0; i < n; i++) {
    while (!b[i][g[i]]) g[i]++;
    who[g[i]] = i;
    for (int j = 0; j < n; j++)
      if (j != i && b[j][g[i]]) {
        c[j] ^= c[i];
        b[j] ^= b[i];
      }
  }
  for (int i = 0; i < m; i++)
    if (c[who[v[i]]][u[i]])
      cout << "NO\n";
    else
      cout << "YES\n";
  return 0;
}
