#include <bits/stdc++.h>
using namespace std;
bitset<2005> a[2005], b[2005];
int n, m;
int x[500005], y[500005];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) scanf("%d%d", &x[i], &y[i]), a[x[i]][y[i]] = 1;
  for (int i = 1; i <= n; i++) b[i][i] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j++) {
      if (a[j][i]) {
        swap(a[j], a[i]);
        swap(b[j], b[i]);
        break;
      }
    }
    for (int j = 1; j <= n; j++)
      if (a[j][i] && i != j) {
        a[j] ^= a[i];
        b[j] ^= b[i];
      }
  }
  for (int i = 1; i <= m; i++)
    if (b[y[i]][x[i]])
      puts("NO");
    else
      puts("YES");
  return 0;
}
