#include <iostream>
#include<bits/stdc++.h>
#include<math.h>
#include<stdio.h>
 
using namespace std;
#define ld long double
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define pf push_front
#define mp make_pair
#define mt make_tuple
#define popb pop_back
#define popf pop_front
#define int  long long int
#define PI 3.1415926535897932
#define all(v) v.begin(),v.end()
#define endl "\n"
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define lop(i,a,b)  for(int i=a;i>=b;i--)
#define prec(x)  cout<<fixed<<setprecision(x)
#define toup(su) transform(su.begin(), su.end(), su.begin(), ::toupper);
#define tolow(su) transform(su.begin(), su.end(), su.begin(), ::tolower);
#define inn(x) cin>>x;
#define outt(x) cout<<x;
vector<int> glen(100001);
//if(concated.find(s2)!=string::npos)
int Mm=998244353 ;
int MOD=Mm;
 
int n1,n2=0, sum=0;
int gcd(int a, int b)                
{
  return (b==0)?a:gcd(b,a%b);
}

 
 
 int po(int a, int b){ 
 
    if(b==0) return 1;

    int temp=po(a,b/2);

    int z=(temp*temp)%MOD;

    if(b%2)
        return (z*a)%MOD;
    else
        return z;
 
} 
 
 
void dfs(int x,map<int,list<int>> &tree, int cats[],int &ans,int m,int s,int parent)
{    
    if(cats[x]==1)
    {
        s++;
    }
    else
      {  s=0;}
 
    if(s>m)
        return;
 
    if(tree[x].size()==1 && x!=1) ans++;
 
    for(auto i:tree[x])
    {
 
        if(i!=parent)
        {
            dfs(i,tree,cats,ans,m,s,x);
            
        }
    }
    return ;
}
 
int fun(int x,int y)
{
    int p=1,q=1;
 
    //rep(i,0,998244351)
    //q=(q*y)%998244353;
 
    //cout<<q<<endl;
 
    p=po(y,998244351);
    //cout<<p<<endl;
 
   x=(x*p)%Mm;
 
    return x;
}
 
 
signed main()
{
    fast
     #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
 
int t=1;

cin>>t;
 
while(t--)
{ 
 int n,q;
 cin>>n>>q;
 string s;
 cin>>s;

 rep(i,0,q)
 {
    int x,y;
    cin>>x>>y;
    string s1=s.substr(x-1,y-x+1);

    char f=s1[0], l=s1[y-x];

    int see=0;

    rep(i,0,x-1)
    {
        if(s[i]==f)
        {
            see=1;
            break;
        }
    }

    if(see==0)
    {
        rep(i,y,n)
        {
            if(s[i]==l)
              {  see=1;
               break;
           }
        }
    }
    if(see) cout<<"YES\n";
    else cout<<"NO\n";
 }
}
 
return 0;
 
 }