#include <bits/stdc++.h>
const double eps = 1e-7, PI = 3.1415926;
const int N = 1e6 + 10;
using namespace std;
int n, q, m, k, x, y, a, b, mx = -1, mn = 1e9, sum;
string s, s1, s2;
map<int, int> mp;
vector<int> vec[4];
int main() {
  cin >> q;
  while (q--) {
    cin >> a >> b;
    cin >> s;
    s += 'X';
    bool ok = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '.')
        sum++;
      else {
        if (sum >= 4 * b + a - 1) ok = 1;
        if (sum >= b && sum < a)
          vec[0].push_back(sum);
        else if (sum >= a && 2 * b > sum)
          vec[1].push_back(sum);
        else if (sum >= 2 * b)
          vec[2].push_back(sum);
        sum = 0;
      }
    }
    if (vec[0].size() || vec[2].size() > 1 || ok) {
      cout << "NO" << endl;
    } else if (!vec[2].size()) {
      if (vec[1].size() % 2)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    } else {
      x = vec[2][0];
      bool ok = 0;
      if (vec[1].size() % 2 == 0 && ((x - a) / 2 >= a || (x - a + 1) / 2 < b))
        cout << "YES" << endl;
      else if (vec[1].size() % 2 && x <= 3 * b + a - 2 && a * 2 <= x)
        cout << "YES" << endl;
      else
        cout << "NO" << endl;
    }
    vec[0].clear();
    vec[1].clear();
    vec[2].clear();
  }
  return 0;
}
