#include <bits/stdc++.h>
#define pb push_back
#define sz(v) (int)(v).size()
#define debug(x) cerr << #x << "_=_" << x << "\n";
#define all(v) begin(v), end(v)
#define fst first
#define snd second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
typedef pair<ii, int> iii;
typedef pair<ll, pll> lll;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
const int MOD = 998244353;
const int oo = 1e9;
template<typename num>
inline num ceil(num a, num b){return (a+b-1)/b;} // (a/b)
template<typename num>
inline num lcm(num a, num b){return a*(b/__gcd(a, b));}
template<typename num>
inline num sum(num x){return x * (x+1) / 2;}    //sum(1...x)

#define int ll
const int MAXN = 3e5+5;

int getFac(int n) {
    if (n <= 2) return 0;
    for (int i = 2; i*i <= n; ++i) {
        if (n%i == 0) return i;
    }
    return 0;
}

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);

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


    int t = 1;
    cin >> t;
    while(t--) {
        int n, q;
        cin >> n >> q;
        string s;
        cin >> s;
        while(q--) {
            int l, r;
            cin >> l >> r;
            bool f=0;
            for (int i = 0; i < l-1; ++i) {
                if (s[i] == s[l-1]) {
                    f=1;
                    break;
                }
            }

            for (int i = r; i < n; ++i) {
                if (s[i] == s[r-1]) {
                    f=1;
                    break;
                }
            }

            cout << (f ? "YES\n" : "NO\n");
        }

    }


    return 0;
}