#773 div 2 E
#include<bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
#define lnode (2 * node)
#define rnode (2 * node + 1)
const int N = 500010;
int arr[N], anode[N], tree[3 * N];
void build_tree(int node, int start, int end){//(1, 1, n)
if(start == end){//当区间里只有这一个点时
tree[node] = arr[end];
anode[end] = node;
return ;
}
//当区间里不止一个点时,先计算出其两个子区间的值,然后取最大
int mid = (start + end) / 2;
build_tree(lnode, start, mid);
build_tree(rnode, mid + 1, end);
tree[node] = max(tree[lnode], tree[rnode]);
}
void update_tree(int node, int idx, int val){//(anode[idx], idx, val)
tree[node] = max(tree[rnode], tree[lnode]);
if(node == anode[idx]) tree[node] = val;//如果是叶子节点,直接取值
if(node == 1) return; //根节点
update_tree(node / 2, idx, val);//node / 2 就是 node 的父节点
}
int query_tree(int node, int start, int end, int l, int r){//(1, 1, n, l ,r)
if(l <= start && end <= r) return tree[node];//区间start-end包含在l-r中
else if(start > r || end < l) return INT_MIN;//区间start-end与l-r没有交集
//剩下一种情况就是区间start-end有部分在l-r中
int mid = (start + end) / 2;
return max(query_tree(lnode, start, mid, l, r), query_tree(rnode, mid + 1, end, l ,r));
}
int main(){
memset(arr, 0x3f, sizeof arr);
int n, q; cin >> n >> q;
vector<pii> Q;
vector<tuple<int, int, int>> ybing;
set<int> s;
for(int i = 1; i <= n; i++) s.insert(i);
for(int i = 1; i <= q; i++) {
int x; cin >> x;
if(!x){
int l, r, f; cin >> l >> r >> f;
if(!f){
auto p = s.lower_bound(l);
while(p != s.end() && *p <= r){
int pv = *p;
arr[pv] = i, s.erase(p); //debug2(pv, i);
p = s.upper_bound(pv);
}
}else ybing.push_back({l, r, i});
}else{
int y; cin >> y;
Q.push_back({i, y});
}
}
build_tree(1, 1, n);
for(auto [l, r, t] : ybing){
auto p = s.lower_bound(l);
auto np = s.upper_bound(*p);
if(np != s.end() && *np <= r) continue;
int pv = *p, tmp = t;
if(l < pv) tmp = max(tmp, query_tree(1, 1, n, l, pv - 1));
if(pv < r) tmp = max(tmp, query_tree(1, 1, n, pv + 1, r));
arr[pv] = min(arr[pv], tmp);//可能第一次确认不如第二次确认早
}
for(auto [t, idx] : Q){
if(arr[idx] < t){
cout << ((s.find(idx) == s.end() ? "NO\n" : "YES\n"));
}else cout << "N/A\n";
}
return 0;
}