#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<functional>
#include<algorithm>
#include<climits>
using namespace std;
#define ll long long
#define ull unsigned long long
#define fo(i, a, b) for (int i = a; i <= b; i++)
#define sc(x) scanf("%d", &x)
#define scl(x) scanf("%lld", &x)
#define pr(x) printf("%d", x)
#define prl(x) printf("%lld", x)
#define prs() printf(" ")
#define prn() printf("\n")
#define pii pair<int, int> 
#define mp make_pair
const double eps = 1e-8;
const int mod = 998244353;
const int N = 7 + 2e3;

char a[110];
int main() {
	int t;
	int n, q;
	sc(t);
	while(t--) {
		sc(n), sc(q);
		scanf("%s", a + 1);
		while(q--) {
			int L, R;
			sc(L), sc(R);
			int flag = 0;
			for (int i = 1; i < L; i++) {
				if(a[i] == a[L]) {
					flag = 1;
					break;
				}
			}
			if(!flag) {
				for (int i = R + 1; i <= n; i++) {
					if(a[i] == a[R]) {
						flag = 1;
						break;
					}
				}
			}
			if(flag) printf("YES\n");
			else printf("NO\n");
		}

	}







	return 0;
}