#include <stdio.h>
int n, m, i, j, k, x, c[105];
int main(){
scanf("%d%d", &n, &m);
for(i=1; i<=m; i++){
scanf("%d%d", &k, &x);
if(k == 3) printf("%s\n", c[x]>1?"Yes":"No");
else c[x] += k;
}//黄牌权值为1,红牌为2,达到2即淘汰
return 0;
}