                                            //***FOR THE LAWS AND THE PURPOSE***//
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define pf push_front
#define pb push_back

ll gcd(ll a, ll b){
  if (b == 0){ return a; }
  return gcd(b, a % b);
}
////////////////////////////////////////////////

//const int MX = 1 + (int)pow(10,2);
ll smallest(ll N){
  for (ll i = 2; i*i <= N; i++) {
    if(N%i == 0 )
      return i;
  }
  return 0;
}

int main()
{
    ios::sync_with_stdio(0);cin.tie(0);

    ll t;
    cin>>t;
    while (t--) {
      /* code */
      ll n,q;
      cin>>n>>q;
      string S;
      cin>>S;

      while (q--) {
        int a,b;
        cin>>a>>b;
        //string Q = S.substr(a-1, b-a +1);
        //std::cout << Q << '\n';

        ll ind1 = a-1;
        ll ind2 = b;
        bool f1 = false;
        bool f2 = false;

        for(int i=0;i<a-1;i++){
            if(S[i]==S[a-1]){
                f1 =true;
                break;
            }
        }
        for(int i=b;i<n;i++){
            if(S[i]==S[b-1]){
                f2 =true;
                break;
            }
        }
        if(f1 or f2)
            cout<<"YES"<<"\n";
        else
            cout<<"NO"<<"\n";
      }

    }
}
