#include<bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(),(v).end()
#define int long long int
#define mod 1000000007

string s;

bool fun(string sb){
	set<int> st;
	int j = 0;
	for(int i=0;i<s.size();i++){
		if(s[i] == sb[j]){
			st.insert(i);
			j++;
			if(j == sb.size())
				break;
		}
	}
	j = sb.size()-1;
	for(int i=(int)s.size()-1;i>=0;i--){
		if(s[i] == sb[j]){
			if(st.find(i) == st.end())
				return false;
			if(j == 0)
				break;
			j--;
		}
	}
	return true;
}

void solve(){
	int n,q; cin>>n>>q;
	cin>>s;
	while(q--){
		int l,r; cin>>l>>r;
		string sb = s.substr(l-1,r-l+1);
		cout<<(fun(sb)?"NO":"YES")<<"\n";
	}
}

signed main(){
	#ifndef ONLINE_JUDGE
	freopen("C:\\input", "r", stdin);
	freopen("C:\\output", "w", stdout);
	#endif
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	int t; cin>>t;
	while(t--)
	solve();
	return 0;
}