#include <bits/stdc++.h>

using namespace std;

#define MOD 1000000007
#define INF 1000000000000000000
#define ll long long
#define ld long double
#define debug(x) cerr << #x << " is " << x << "\n"

int t, n, q, l, r;
string s;
bool flag;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> t;
    while (t--)
    {
        cin >> n >> q >> s;
        for (int i = 0; i < q; i++)
        {
            flag = false;
            cin >> l >> r;
            for (int j = r; j < n; j++)
            {
                if (s[j] == s[r - 1])
                    flag = true;
            }
            for (int j = 0; j < l - 1; j++)
            {
                if (s[j] == s[l - 1])
                    flag = true;
            }
            cout << (flag ? "YES\n" : "NO\n");
        }
    }
}
