#include <bits/stdc++.h>   using namespace std;   int n, m;   pair<int, int> t[500050];   bitset<2020> P[2020], B[2020];   void solve() {     scanf( %d%d , &n, &m);     for (int i = 0; i < m; i++) {       int x, y;       scanf( %d%d , &x, &y);       t[i] = pair<int, int>(x, y);       P[x][y] = 1;     }     for (int i = 1; i <= n; i++) B[i][i] = 1;     for (int i = 1; i <= n; i++) {       int f = -1;       for (int j = i; j <= n; j++)         if (P[j].test(i)) {           f = j;           break;         }       swap(P[f], P[i]);       swap(B[f], B[i]);       for (int j = 1; j <= n; j++)         if (i != j && P[j][i]) {           P[j] ^= P[i];           B[j] ^= B[i];         }     }     for (int i = 0; i < m; i++) {       if (B[t[i].second][t[i].first])         puts( NO );       else         puts( YES );     }   }   int main() {     int Tc = 1;     for (int tc = 1; tc <= Tc; tc++) {       solve();     }     return 0;   }   