#include <bits/stdc++.h>
using word = uint32_t;
static constexpr size_t WORD_BITS = sizeof(word) * 8;
struct F2_incr_elim {
  size_t nRows, nCols;
  std::unique_ptr<word[]> data;
  word* nextRow;
  std::unique_ptr<word*[]> rows;
  F2_incr_elim(size_t nCols)
      : nRows(0),
        nCols(nCols),
        data(new word[wordsPerRow() * nCols]),
        rows(new word* [nCols] {}) {}
  F2_incr_elim(const F2_incr_elim& o)
      : nRows(o.nRows),
        nCols(o.nCols),
        data(new word[wordsPerRow() * nCols]),
        rows(new word*[nCols]) {
    memcpy(data.get(), o.data.get(), nRows * wordsPerRow() * sizeof(word));
    for (size_t i = 0; i < nCols; i++) {
      word* orow = o.rows[i];
      rows[i] = orow ? data.get() + (orow - o.data.get()) : nullptr;
    }
  }
  size_t wordsPerRow() const { return (nCols + WORD_BITS - 1) / WORD_BITS; }
  static word bitOfRow(const word* row, size_t i) {
    word w = row[i / WORD_BITS];
    return (w >> (i % WORD_BITS)) & (word)1;
  }
  bool addRow(const word* newRow) {
    assert(nRows < nCols);
    word* nextRow = data.get() + nRows * wordsPerRow();
    memcpy(nextRow, newRow, wordsPerRow() * sizeof(word));
    for (size_t c = 0; c < nCols; c++) {
      if (!bitOfRow(nextRow, c)) continue;
      word* row = rows[c];
      if (row) {
        for (size_t i = c / WORD_BITS; i < wordsPerRow(); ++i)
          nextRow[i] ^= row[i];
      } else {
        for (auto c2 = c + 1; c2 < nCols; c2++) {
          if (bitOfRow(nextRow, c2) && (row = rows[c2])) {
            for (size_t i = c2 / WORD_BITS; i < wordsPerRow(); i++)
              nextRow[i] ^= row[i];
          }
        }
        for (auto c2 = c; c2--;) {
          if ((row = rows[c2]) && bitOfRow(row, c)) {
            for (size_t i = c / WORD_BITS; i < wordsPerRow(); i++)
              row[i] ^= nextRow[i];
          }
        }
        rows[c] = nextRow;
        ++nRows;
        return true;
      }
    }
    return false;
  }
};
void calc(F2_incr_elim& e, size_t n, size_t rowsLeft, const word* matrix,
          const int* qid, bool* out) {
  if (rowsLeft == 1) {
    size_t lastCol = 0;
    while (e.rows[lastCol]) ++lastCol;
    for (size_t c = 0; c < n; c++) {
      if (!F2_incr_elim::bitOfRow(matrix, c)) continue;
      bool even = c == lastCol || F2_incr_elim::bitOfRow(e.rows[c], lastCol);
      out[qid[c]] = !even;
    }
    return;
  }
  auto mid = rowsLeft / 2;
  auto wpr = e.wordsPerRow();
  F2_incr_elim copy(e);
  for (size_t i = mid; i < rowsLeft; ++i)
    if (!copy.addRow(matrix + i * wpr)) assert(false);
  calc(copy, n, mid, matrix, qid, out);
  for (size_t i = 0; i < mid; i++)
    if (!e.addRow(matrix + i * wpr)) assert(false);
  calc(e, n, rowsLeft - mid, matrix + mid * wpr, qid + mid * n, out);
}
int main(int argc, char** argv) {
  std::ios_base::sync_with_stdio(false);
  if (argc == 2) freopen(argv[1], "r", stdin);
  int n, m;
  scanf("%d %d", &n, &m);
  F2_incr_elim e0(n);
  auto wpr = e0.wordsPerRow();
  word* rows = new word[n * wpr]{};
  int* qid = new int[n * n];
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    --a;
    --b;
    word& w = (rows + a * wpr)[b / WORD_BITS];
    w |= (word)1 << (b % WORD_BITS);
    qid[a * n + b] = i;
  }
  bool* out = new bool[m];
  calc(e0, n, n, rows, qid, out);
  for (int i = 0; i < m; i++) puts(out[i] ? "YES" : "NO");
  return 0;
}
