#include<bits/stdc++.h>

#define fi first

#define sc second

#define N 1000005

using namespace std;

typedef pair<int , int> II;

typedef pair<int , char> IC;

typedef pair<II , int> III;

typedef pair<II , II> IV;

typedef pair<int , long long> IL;

typedef pair<long long , int> LI;

typedef pair<IL , int> ILI;

int length , query;

char words[N];

int max_nex[N];

void solve()
{
    scanf("%d %d", &length , &query );

    scanf("%s", words + 1 );

    for(int i =1 ;i <= query; i++){

        int from , to; scanf("%d %d", &from , &to );

        bool is_good = false;

        for(int j = 1 ; j < from ; j++)

            if( words[j] == words[from] ) is_good = true;

        for(int j = to + 1 ;j <= length; j++)

            if( words[j] == words[to] ) is_good = true;

        if( is_good ) printf("YES\n");

        else printf("NO\n");
    }
}

int main()
{
    ///freopen("main.inp", "r", stdin );

    int tester ; scanf("%d", &tester );

    while( tester-- ) solve();
}
