#include <iostream>
#include <set>
#include <queue>
#include <vector>
#include <string>
#include <math.h>
#include <cmath>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <algorithm>
#include <stdio.h>
#include <cstring>                    
#include <sstream>
#include <numeric>
#include <assert.h>
#include <ctime>

using namespace std;

#define ll long long
#define lop(i,n) for(int i=0; i<n; i++)

ll const N = 2e5 + 10;
ll const INF = 1e18;
ll const mod = 1e9 + 7;

///////////////////////////////////////////////////////////////////

int t, n, q;
string s;

void solve(){
	while(q--){
		int l, r;
		cin >> l >> r;
		l--, r--;
		bool ok = 0;

		for(int i=0; i<l; i++) if(s[i] == s[l]){ ok=1; break; }
		for(int i=r+1; i<n; i++) if(s[i] == s[r]){ ok=1; break; }
		if(ok)cout << "YES\n";
		else cout << "NO\n";
	}

	return;
}

int main(){
	cin >> t;
	while(t--) { cin >> n >> q >> s; solve(); }
return 0;}