#include<bits/stdc++.h>
using namespace std;
#define ll long long
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;
            int ans=0;
            for(int i=0;i<l-1;i++)
            {
                if(s[i]==s[l-1])
                {
                    ans=1;
                    break;
                }
            }
            for(int j=r;j<n;j++)
            {
                if(s[j]==s[r-1])
                {
                    ans=1;
                    break;
                }
            }
            if(ans)
              cout<<"YES"<<endl;
             else
             cout<<"NO"<<endl; 
        }
    }
}