#include <bits/stdc++.h>
using namespace std;
void solve_case() {
  int a, b;
  string t;
  cin >> a >> b >> t;
  int N = t.length();
  int n1 = 0, n2 = 0, n3 = 0, n4 = 0, big = 0;
  for (int i = 0; i < N; ++i) {
    if (t[i] == '.') {
      int j = i;
      while (j < N && t[j] == '.') j++;
      int len = j - i;
      if (len < b) {
        n1++;
      } else if (len < a) {
        n2++;
      } else if (len < 2 * b) {
        n3++;
      } else {
        n4++;
      }
      big = max(big, len);
      i = j;
    }
  }
  if (n2 > 0 || n4 > 1) {
    cout << "NO\n";
    return;
  }
  if (n4 == 0) {
    cout << (n3 % 2 == 1 ? "YES" : "NO") << "\n";
    return;
  }
  for (int l = 0; l + a <= big; ++l) {
    int r = big - l - a;
    if (max(l, r) >= 2 * b) continue;
    if ((l >= b && l < a) || (r >= b && r < a)) continue;
    int plus = 0;
    if (l >= a) plus++;
    if (r >= a) plus++;
    if ((n3 + plus) % 2 == 0) {
      cout << "YES"
           << "\n";
      return;
    }
  }
  cout << "NO\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int Q;
  cin >> Q;
  while (Q--) solve_case();
  return 0;
}
