#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
char S[N];
void prc() {
  int a, b;
  scanf("%d%d", &a, &b);
  scanf("%s", (S + 1));
  int n = strlen(S + 1);
  int curr = 0;
  int num = 0;
  bool used = false;
  int siz = 0;
  S[n + 1] = 'X';
  for (int i = 1; i <= n + 1; i++) {
    if (S[i] == '.')
      curr++;
    else {
      if (curr < a && curr >= b) {
        printf("NO\n");
        return;
      }
      if (curr >= 2 * b) {
        if (used) {
          printf("NO\n");
          return;
        }
        used = true;
        siz = curr;
      } else if (curr >= a)
        num++;
      curr = 0;
    }
  }
  if (!used) {
    if (num % 2 == 0)
      printf("NO\n");
    else
      printf("YES\n");
    return;
  }
  bool chance1 = false;
  bool chance2 = false;
  for (int i = 0; i <= siz - a; i++) {
    int j = siz - a - i;
    if (i >= 2 * b || j >= 2 * b) continue;
    if ((i >= b && i < a) || (j >= b && j < a)) continue;
    int count = (int)(i >= a) + (int)(j >= a);
    if (count % 2 == 0)
      chance2 = true;
    else
      chance1 = true;
  }
  if (!chance1 && !chance2) {
    printf("NO\n");
    return;
  }
  if (num % 2 == 1) {
    if (chance1)
      printf("YES\n");
    else
      printf("NO\n");
    return;
  }
  if (chance2)
    printf("YES\n");
  else
    printf("NO\n");
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) prc();
}
