#include <bits/stdc++.h>
using namespace std;
int n, k;
int tope;
int m[2000][2000];
int a[1000000];
int b[1000000];
void escribe() {
  for (int i = 0; i < n; i++) {
    for (int d = 0; d < n; d++) {
      int j = d / 30;
      int jmod = d % 30;
      cout << ((m[i][j] & (1 << jmod)) != 0);
    }
    cout << endl;
  }
  cout << endl;
}
int posicion[2000];
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> k;
  tope = 0;
  while (30 * tope < 2 * n) tope++;
  for (int d = 0; d < k; d++) {
    cin >> a[d] >> b[d];
    a[d]--;
    b[d]--;
    int i = a[d];
    int j = b[d] / 30;
    int jmod = b[d] % 30;
    m[i][j] |= 1 << jmod;
  }
  for (int i = 0; i < n; i++) {
    int d = i + n;
    int j = d / 30;
    int jmod = d % 30;
    m[i][j] |= (1 << jmod);
  }
  for (int i = 0; i < n; i++) {
    int j = i / 30;
    int jmod = i % 30;
    if ((m[i][j] & (1 << jmod)) == 0) {
      for (int ii = i + 1; ii < n; ii++) {
        if (m[ii][j] & (1 << jmod)) {
          int *p1 = &(m[i][j]);
          int *p2 = &(m[ii][j]);
          for (int jj = j; jj < tope; jj++, p1++, p2++) {
            m[i][jj] ^= m[ii][jj];
          }
          break;
        }
      }
    }
    for (int ii = 0; ii < n; ii++) {
      if (ii != i and (m[ii][j] & (1 << jmod))) {
        int *p1 = &(m[i][j]);
        int *p2 = &(m[ii][j]);
        for (int jj = j; jj < tope; jj++, p1++, p2++) {
          m[ii][jj] ^= m[i][jj];
        }
      }
    }
  }
  for (int caso = 0; caso < k; caso++) {
    int d = a[caso] + n;
    int i = b[caso];
    int j = d / 30;
    int jmod = d % 30;
    if (m[i][j] & (1 << jmod))
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
}
