#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define pp pop_back
#define in insert
#define ff first
#define ss second
#define  show for(int j=0;j<v.size();j++) cout<<v[j]<<" ";
#define ld long double
#define e endl
#define bc __builtin_popcount
#define MOD 1000000007
#define MAXN 200005
#define INT_SIZE 32
#define debug cout<<"we are debugging"<<endl;
#define me(x) memset(x,0,sizeof(x))
ll fast_expo(ll x,ll p)
{if(p==0) return 1;
else if(p%2==0){ ll t=fast_expo(x,p/2)%MOD;return (t*t)%MOD;} else return (x*(fast_expo(x,p-1))%MOD)%MOD;}
int main()
{
     int t;
     cin>>t;
     while(t--)
     {
          int n,q;
          cin>>n>>q;
          string s;
          cin>>s;
          while(q--)
          {
               int l,r;
               cin>>l>>r;
               l--;r--;
               int f=0;
               for(int i=0;i<l;i++)
               {
                    if(s[i]==s[l])
                    {
                         f=1;
                    }
               }
               for(int i=r+1;i<n;i++)
               {
                    if(s[i]==s[r])
                    {
                         f=1;
                    }
               }
               if(f==0)
                    cout<<"NO";
               else
                    cout<<"YES";
                    cout<<'\n';
          }
     }
}

