 #include<bits/stdc++.h>
 using namespace std;
 #define ll long long int
 #define mxN

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

       ll t;
       cin >> t;
       while(t--)
       {
            int n,q;
            cin>>n>>q;
            string s;
            cin>>s;
            int one[111]={0},zero[111]={0},rev_o[111]={0},rev_z[111]={0};
            for(int i=0;i<n;i++){
                if(s[i]=='1') one[i]++;
                else zero[i]++;
                if(i!=0) one[i]+=one[i-1],zero[i]+=zero[i-1];
            }
            for(int i=n-1;i>=0;i--){
                if(s[i]=='1') rev_o[i]++;
                else rev_z[i]++;
                if(i!=n-1) rev_o[i]+=rev_o[i+1],rev_z[i]+=rev_z[i+1];
            }
            while(q--){
                int l,r;
                cin>>l>>r;
                if(r-l+1==n) cout<<"NO\n";
                else{
                    int f=0;
                    l--,r--;
                    if(l>0 && s[l]=='0'&& zero[l-1]) f=1;
                    if(l>0 && s[l]=='1'&& one[l-1]) f=1;
                    if(r<n-1 && s[r]=='0'&& rev_z[r+1]) f=1;
                    if(r<n-1 && s[r]=='1'&& rev_o[r+1]) f=1;
                    if(f) cout<<"YES\n";
                    else cout<<"NO\n";

                }


            }
       }

       return 0;
 }
