/*      bismillahir rahmanir rahim   
 *		     @ monjurul0007
 */


#include <bits/stdc++.h>

using namespace std;

#define fasterInOut ios::sync_with_stdio(false); cin.tie(0);
#define pb push_back
#define all(x) x.begin(),x.end()
#define mem(arr,value) memset(arr, value, sizeof(arr))
#define F first
#define S second
#define mod 1000000007
#define pi acos(-1)

typedef long long int ll;    
typedef unsigned long long int ull;   
typedef pair<ll , ll>  pii;
typedef pair<int , pii > piii; 
typedef priority_queue <pii, vector<pii> , greater<pii> > pq;

const int dx4[4] = {0,1,0,-1};
const int dy4[4] = {1,0,-1,0};
const int dx8[8] = {0,1,0,-1,1,-1,1,-1};
const int dy8[8] = {1,0,-1,0,1,-1,-1,1};

int main(){
	fasterInOut;	
	
	int t;
	cin >> t;
	
	while(t--){
		int n,q;
		cin >> n >> q;
		
		string s;
		cin >> s;
		
		while(q--){
			int a,b;
			cin >> a >> b;
			
			bool flag = false;
			
			for(int i=b; i<n; i++)
				if(s[b-1] == s[i]){
					flag = true;
					break;
				}
			
			for(int i=0; i<a-1; i++)
				if(s[a-1] == s[i]){
					flag = true;
					break;
				}
			
			
			if(flag) cout << "YES\n";
			else cout << "NO\n";
		}
	}
	
	return 0;
	
}
