#include <bits/stdc++.h>
const int N = 2e3 + 100;
const int M = 5e5 + 100;
int n, m;
std::pair<int, int> a[M];
void init() {
  std::cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &a[i].first, &a[i].second);
  }
}
void work() {
  static std::bitset<N * 2> matrix[N];
  for (int i = 1; i <= m; i++) {
    matrix[a[i].first][a[i].second] = 1;
  }
  for (int i = 1; i <= n; i++) {
    matrix[i][i + n] = 1;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j++) {
      if (matrix[j][i] == 1) {
        std::swap(matrix[j], matrix[i]);
        break;
      }
    }
    for (int j = 1; j <= n; j++) {
      if (j != i && matrix[j][i] == 1) {
        matrix[j] ^= matrix[i];
      }
    }
  }
  for (int i = 1; i <= m; i++) {
    if (matrix[a[i].second][a[i].first + n] == 0) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
}
int main() {
  init();
  work();
  return 0;
}
