#include <bits/stdc++.h>
char s[300005];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int a, b;
    scanf("%d %d", &a, &b);
    scanf("%s", s);
    int mx = 0, tmp = 1;
    int cntOnlyB = 0, cnt2 = 0, cnta = 0;
    for (int i = 0; s[i] != '\000'; i++) {
      if (s[i] == 'X') continue;
      int len = 0;
      for (; s[i] == '.'; i++, len++)
        ;
      i--;
      if (b <= len && len < a) cntOnlyB++;
      if (2 * b <= len) cnt2++, mx = std::max(mx, len);
      if (a <= len && len < 2 * b) cnta++;
    }
    for (int i = 0; i + a <= mx; i++)
      tmp = std::min(
          tmp, (int)(std::max(i, mx - a - i) >= 2 * b || (b <= i && i < a) ||
                     (b <= mx - a - i && mx - a - i < a) ||
                     (cnta + (a <= i && i < 2 * b) +
                      (a <= mx - a - i && mx - a - i < 2 * b)) %
                             2 ==
                         1));
    if ((cntOnlyB > 0) || (cnt2 > 1) || (cnt2 == 0 && cnta % 2 == 0) ||
        (cnt2 == 1 && tmp))
      printf("NO\n");
    else
      printf("YES\n");
    for (int i = 0; s[i] != '\000'; i++) s[i] = '\000';
  }
  return 0;
}
