#include <bits/stdc++.h>
void solve() {
  int a, b, n;
  std::string s;
  std::cin >> a >> b >> s, n = s.size(), s += 'X';
  int lst = -1, qaq = 0, qwq = 0;
  for (int i = 0; i <= n; ++i)
    if (s[i] == 'X') {
      int len = i - lst - 1;
      lst = i;
      if (len < b) continue;
      if (len < a)
        return std::cout << "NO\n", void(0);
      else if (len >= b * 2) {
        if (qaq) return std::cout << "NO\n", void(0);
        qaq = len;
      } else {
        qwq ^= 1;
      }
    }
  if (!qaq)
    return std::cout << (qwq & 1 ? "YES" : "NO") << '\n', void(0);
  else {
    for (int i = 0; i + a <= qaq; ++i) {
      int l1 = i, l2 = qaq - a - i;
      if (l1 >= b && l1 < a) continue;
      if (l2 >= b && l2 < a) continue;
      if (l1 >= 2 * b || l2 >= 2 * b) continue;
      if (qwq ^ (l1 >= b) ^ (l2 < b)) return std::cout << "YES\n", void(0);
    }
    std::cout << "NO\n";
  }
}
int main() {
  std::ios::sync_with_stdio(0), std::cin.tie(0);
  int tc;
  std::cin >> tc;
  while (tc--) solve();
  return 0;
}
