#include <bits/stdc++.h>
using namespace std;
char c[400000];
int lib[400000], cnt = 0;
int n, T, a, b;
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%d%d", &a, &b);
    scanf("%s", c + 1);
    n = strlen(c + 1);
    int pos = 0;
    cnt = 0;
    for (int i = 1; i <= n; i++) {
      if (c[i] == 'X') {
        if (pos >= b) lib[++cnt] = pos;
        pos = 0;
      }
      if (c[i] == '.') pos++;
    }
    if (pos >= b) lib[++cnt] = pos;
    pos = 0;
    bool flag = 1;
    int kl = 0, it = 0;
    for (int i = 1; i <= cnt; i++) {
      if (lib[i] < a) flag = 0;
      if (lib[i] >= 2 * b) kl++, it = lib[i];
    }
    if (!flag || (kl >= 2)) {
      puts("NO");
      continue;
    }
    if (!kl) {
      (cnt & 1) ? puts("YES") : puts("NO");
      continue;
    }
    flag = 0;
    for (int i = 0; i <= it - a && !flag; i++) {
      int l = i, r = it - a - i, op = cnt;
      if (l >= 2 * b || r >= 2 * b || (l < a && l >= b) || (r < a && r >= b))
        continue;
      if (l >= a && l < 2 * b) op++;
      if (r >= a && r < 2 * b) op++;
      if (op & 1) flag = 1;
    }
    if (flag)
      puts("YES");
    else
      puts("NO");
  }
}
