#include<bits/stdc++.h>
#define sz(x) ((int)(x).size())
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
using namespace std;
 
typedef long long lld;
typedef vector<lld> vlld;
typedef pair<lld,lld> pi;
typedef tuple<lld,lld,lld> tup;
const lld mod=(lld)1e9+7;
 
 
int main() {

	lld t;
	//t=1;
	cin>>t;
	while(t--)
	{
       
       lld n,q;
       cin>>n>>q;
       string s;
       cin>>s;
       lld x,y;
       for(int i=0;i<q;i++)
       {
       	     cin>>x>>y;
       	     x--,y--;
       	     lld f=0;
       	     for(int i=0;i<x;i++)
       	     {
                   if(s[i]==s[x])
                   {
                   	f=1;
                   	break;
                   }
       	     }
       	     if(!f)
       	     {
       	     for(int i=y+1;i<n;i++)
       	     {
                   if(s[i]==s[y])
                   {
                   	f=1;
                   	break;
                   }
       	     }
       	     }

       	     if(f)
       	     	cout<<"YES";
       	     else
       	     	cout<<"NO";
       	     cout<<"\n";

       }
     
	}
  
  return 0;
}