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


int main() {

#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	int t;
	cin >> t;
	while (t--) {
		int n, q;
		string s;
		cin >> n >> q >> s;
		while (q--) {
			int i, l, r, prev = -1, ind = INT_MIN;
			cin >> l >> r;
			string ans = "NO";
			--l;
			int l1 = l;
			--r;
			bool first = true;
			for (i = 0; i < n; ++i) {
				if (s[i] == s[l]) {
					if (first) {
						ind = i;
						first = false;
					}
					if (l == r) {
						break;
					}
					++l;
				}

			}
			if (r - l1 == i - ind) {
				for (i += 1; i < n; ++i) {
					if (s[i] == s[r]) {
						ans = "YES";
						break;
					}
				}
			}
			else {
				ans = "YES";
			}
			cout << ans << endl;
		}
	}
}