#include <bits/stdc++.h>

int main()
{
    int t;
    std::cin >> t;
    while (t--)
    {
        int n, q;
        std::cin >> n >> q;

        std::string s;
        std::cin >> s;

        for (int i = 0; i < q; i++)
        {
            int l, r;
            std::cin >> l >> r;

            l--;
            r--;

            bool found = false;
            for (int j = l - 1; j >= 0; j--)
            {
                if (s[l] == s[j])
                {
                    found = true;
                    break;
                }
            }
            for (int j = r + 1; j < n; j++)
            {
                if (s[r] == s[j])
                {
                    found = true;
                    break;
                }
            }

            if (found)
                std::cout << "YES" << std::endl;
            else
                std::cout << "NO" << std::endl;
        }
    }
    return 0;
}