#include <bits/stdc++.h>
using namespace std;
int a, b, n, sum, q[300005], top, T, t;
char ch[300005];
int gets() {
  int v = 0;
  char ch;
  bool f = 0;
  while (!isdigit(ch = getchar()))
    if (ch == '-') f = 1;
  v = ch - 48;
  while (isdigit(ch = getchar())) v = (v << 1) + (v << 3) + ch - 48;
  return f ? -v : v;
}
void test() {
  a = gets(), b = gets();
  scanf("%s", ch + 1);
  n = strlen(ch + 1);
  sum = top = 0;
  for (int i = 1; i <= n; i++) {
    if (ch[i] == '.')
      sum++;
    else {
      if (sum) q[++top] = sum, sum = 0;
    }
  }
  if (sum) q[++top] = sum;
  sort(1 + q, 1 + q + top);
  sum = 0;
  for (int i = 1; i <= top; i++) {
    if (q[i] < a && q[i] >= b) {
      puts("NO");
      return;
    }
    if (i != top && q[i] >= 2 * b) {
      puts("NO");
      return;
    }
    if (i != top && q[i] >= a) sum++;
  }
  t = q[top];
  if (t < a) {
    puts("NO");
    return;
  }
  if (a >= 2 * b) {
    if (sum) {
      puts("NO");
      return;
    }
    if (t <= 2 * b - 2 + a) {
      puts("YES");
      return;
    }
    puts("NO");
    return;
  }
  if (sum % 2 == 0) {
    if (t >= a && t <= 2 * b - 2 + a) {
      puts("YES");
      return;
    }
    if (t >= 3 * a && t <= 4 * b + a - 2) {
      puts("YES");
      return;
    }
    puts("NO");
    return;
  } else {
    if (t >= 2 * a && t <= 3 * b + a - 2) {
      puts("YES");
      return;
    }
    puts("NO");
    return;
  }
}
int main() {
  T = gets();
  while (T--) test();
  return 0;
}
