#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244353;
long long POW(long long a, long long b, long long MMM = MOD) {
  long long ret = 1;
  for (; b; b >>= 1, a = (a * a) % MMM)
    if (b & 1) ret = (ret * a) % MMM;
  return ret;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) {
  if (a == 0 || b == 0) return a + b;
  return a * (b / gcd(a, b));
}
int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}, dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
int ddx[] = {2, 2, -2, -2, 1, 1, -1, -1}, ddy[] = {1, -1, 1, -1, 2, -2, 2, -2};
char s[300005];
int a, b, n;
void solve() {
  scanf("%d%d%s", &a, &b, s);
  n = strlen(s);
  int tmp = 0;
  vector<int> v;
  for (int(i) = (0); (i) <= (n - 1); (i) += (1)) {
    if (s[i] == 'X') {
      if (tmp > 0) v.push_back(tmp);
      tmp = 0;
    } else
      tmp++;
  }
  if (tmp > 0) v.push_back(tmp);
  int c1 = 0, c2 = 0;
  int l = -1;
  for (int x : v) {
    if (x < b) continue;
    if (x < a) {
      puts("NO");
      return;
    }
    if (x < 2 * b) c1++;
    if (x >= 2 * b) {
      c2++;
      l = x;
    }
  }
  if (c2 > 1) {
    puts("NO");
    return;
  }
  if (c2 == 0) {
    puts(c1 & 1 ? "YES" : "NO");
    return;
  }
  for (int t1 = 0; l - a - t1 >= 0; t1++) {
    int t2 = l - a - t1;
    if (t1 >= 2 * b || (t1 >= b && t1 < a)) continue;
    if (t2 >= 2 * b || (t2 >= b && t2 < a)) continue;
    int c = 0;
    if (t1 >= a && t1 < 2 * b) c++;
    if (t2 >= a && t2 < 2 * b) c++;
    if ((c1 + c) % 2 == 0) {
      puts("YES");
      return;
    }
  }
  puts("NO");
}
int main() {
  int tc;
  scanf("%d", &tc);
  while (tc--) solve();
}
