#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int N = 3e5 + 10;
char str[N];
int main() {
  int T = read();
  while (T--) {
    int a = read(), b = read(), tot = 0;
    scanf("%s", str + 1);
    int len = strlen(str + 1), tmp = 0, num = -1, Cnt = 0;
    for (int i = 1; i <= len + 1; ++i)
      if (str[i] == 'X' || str[i] == '\0') {
        if (tmp < b)
          ;
        else if (tmp >= b && tmp < a) {
          tot = 1;
          break;
        } else if (tmp >= 2 * b) {
          if (num == -1)
            num = tmp;
          else {
            tot = 1;
            break;
          }
        } else
          Cnt++;
        tmp = 0;
      } else
        tmp++;
    if (tot) {
      printf("NO\n");
      continue;
    }
    if (num != -1) {
      int fl = 0;
      for (int i = 0; i <= num - a; ++i) {
        int j = num - a - i, now = Cnt;
        if (i >= 2 * b || j >= 2 * b) continue;
        if (i >= b && i < a) continue;
        if (j >= b && j < a) continue;
        if (i >= b) now++;
        if (j >= b) now++;
        if (now % 2 == 0) fl = 1;
      }
      if (fl)
        printf("YES\n");
      else
        printf("NO\n");
    } else {
      if (Cnt & 1)
        printf("YES\n");
      else
        printf("NO\n");
    }
  }
  return 0;
}
