#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <iterator>
#include <cmath>
#include <set>
#include <deque> 
#include <string>


using namespace std;


int n, q;
char s[110];


bool checkL(int l) {
	char ch = s[l];
	int pL = l - 1;
	while (pL >= 1) {
		if (s[pL] == s[l]) {
			return true;
		}
		pL--;
	}
	
	return false;
}

bool checkR(int r) {
	char ch = s[r];
	int pR = r + 1;
	while (pR <= n) {
		if (s[pR] == s[r]) {
			return true;
		}
		pR++;
	}
	
	return false;
}

int main()
{
	int T;
	scanf("%d", &T);

	for (int ii = 0 ; ii < T ; ii++) {
		scanf("%d%d\n", &n, &q);
		
		scanf("%s\n", s);
		for (int i = n ; i >= 1 ; i--) {
			s[i] = s[i - 1];
		}
		s[0] = ' ';
		
		for (int i = 0 ; i < q ; i++) {
			int l, r;
			scanf("%d%d\n", &l, &r);
			
			bool isAccepted;
			if (checkL(l)) {
				printf("YES\n");
				continue;
			}
			
			if (checkR(r)) {
				printf("YES\n");
				continue;
			}
			
			printf("NO\n");
		}
		
		
	}
	return 0;
}
