#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<stack>
#define LL long long
#define N 1010
using namespace std;

char s[N];
int t,n,l,r,m;
inline bool check(int x,int y)
{
	for( int i=1;i<=x-1;i++)
	{
		if( s[i] == s[x] ) return true;
	}
	for(int i=y+1;i<=n;i++)
	{
		if( s[i] == s[y] ) return true;
	}
	return false;
}

int main()
{
//	freopen("in.txt","r",stdin);
	cin>>t;
	while( t-- )
	{
		scanf("%d %d",&n,&m);
		scanf("%s",s+1);
		for(int i=1;i<=m;i++)
		{
			scanf("%d %d",&l,&r);
			if( check(l,r)==true ) printf("YES\n");
			else printf("NO\n");
		}
	}
	return 0;
}
 	   		 	   		   		 	   		 	  	