#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
#define int ll

#define pb push_back
#define db long double
#define x first
#define y second

void fix(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}

void solveA(){
    int n;cin >> n;
    int ans = 0;
    if(n == 1) {
        cout << 0 << endl;
        return;
    }
    while(n%2) {
        n--; ans++;
    }
    if(n == 2) {
        cout << ans+1 << endl;
        return;
    }
    cout << ans+2 << endl;
}

void solveB(){
    int n, q; cin >>n >> q;
    string s; cin >> s;
    while(q--) {
        int l, r; cin >> l >> r; l--; r--;


        int cnt = 0;
        bool ch = 0;
        int nx = s[l+1];
        for(int i = 0; i < n; i++){
            if(cnt == r - l + 1) {
                if(ch) break;
                else {
                    int cur = i;
                    while (cur < n && s[cur] != s[r]) cur++;
                    if(cur != n) ch = 1;
                    break;
                }
            }
            if(cnt > 0 && s[i] != s[l + cnt]) ch = 1;
            if(cnt != r - l + 1 && s[i] == s[l+cnt]){
                cnt++;
            }
        }
        if(ch && cnt == r - l + 1) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }

    }
}

signed main(){
    int tt; cin >> tt; while(tt--)
    solveB();
}

