#include <bits/stdc++.h>
using namespace std;
mt19937 gen(chrono::system_clock::now().time_since_epoch().count());
const int N = 3e5 + 100;
const int MOD = 1e9 + 7;
const int rx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int ry[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const long double eps = 1e-7;
const double pi = acos(-1.0);
const int INF = 2e9;
void solve() {
  int a, b;
  cin >> a >> b;
  string s;
  cin >> s;
  vector<int> l;
  int k = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '.')
      k++;
    else {
      if (k) l.push_back(k);
      k = 0;
    }
  }
  if (k) l.push_back(k);
  int k1 = 0, k2 = 0, k3 = 0, k4 = 0;
  for (auto it : l) {
    if (it < b)
      k1++;
    else if (it >= b && it < a)
      k2++;
    else if (it >= a && it < 2 * b)
      k3++;
    else
      k4++;
  }
  if (k2 || k4 > 1)
    cout << "NO" << endl;
  else if (k4) {
    bool f = false;
    int need;
    if (k3 % 2 == 1)
      need = 1;
    else
      need = 2;
    for (auto it : l) {
      if (it < 2 * b) continue;
      int t1 = 0;
      while (t1 + a <= it) {
        if ((t1 < b || (t1 >= a && t1 < 2 * b)) &&
            (it - t1 - a < b || (it - t1 - a >= a && it - t1 - a < 2 * b))) {
          int z = 0;
          if (t1 >= a) z++;
          if (it - t1 - a >= a) z++;
          if (z == need || (z == 0 && need == 2)) {
            f = true;
            break;
          }
        }
        t1++;
      }
    }
    if (!f)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  } else if (k3 % 2 == 0)
    cout << "NO" << endl;
  else
    cout << "YES" << endl;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int T;
  cin >> T;
  while (T--) {
    solve();
  }
  return 0;
}
