#include <iostream>
#include <cstring>
#include <string>
using namespace std;
bool b[100005],before[100005],after[100005];
int main(){
int t;
cin>>t;
while(t--){
int n,q;
string s;
cin>>n>>q>>s;
for(int i=0;i<n;i++){
if(b[s[i]-'0'])before[i]=1;
b[s[i]-'0']=1;
}
memset(b,0,sizeof b);
for(int i=n-1;i>=0;i--){
if(b[s[i]-'0'])after[i]=1;
b[s[i]-'0']=1;
}
while(q--){
int l,r;
cin>>l>>r;
l--;
r--;
if(before[l]||after[r])cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
memset(b,0,sizeof b);
memset(before,0,sizeof before);
memset(after,0,sizeof after);
}
}