#include <bits/stdc++.h>
using namespace std;
char s[500005];
vector<int> L;
void process() {
  L.clear();
  int n = strlen(s);
  int i, current = 0;
  for (i = 0; i < n; i++) {
    if (s[i] == '.')
      current++;
    else {
      if (current > 0) L.push_back(current);
      current = 0;
    }
  }
  if (current > 0) L.push_back(current);
}
int main() {
  int t, i, j, a, b, T = 1;
  bool possible;
  scanf("%d", &T);
  for (t = 1; t <= T; t++) {
    scanf("%d %d ", &a, &b);
    gets(s);
    process();
    possible = true;
    int neutral = 0, bzone = 0, b2zone = 0, abzone = -1;
    for (i = 0; i < L.size(); i++) {
      if (L[i] < b) continue;
      if (L[i] >= b && L[i] < a) bzone++;
      if (L[i] >= b * 2) b2zone++;
      if (L[i] >= a + b - 1)
        abzone = L[i];
      else if (L[i] >= a && L[i] < a + b - 1) {
        neutral++;
      }
    }
    possible =
        !(bzone > 0 || b2zone > 1 || (abzone == -1 && neutral % 2 == 0) ||
          (abzone >= a + b * 4 - 1));
    if (possible) {
      if (abzone == -1)
        possible = (neutral % 2 > 0);
      else if (neutral % 2 == 0) {
        possible = (abzone < a + b * 2 - 1 ||
                    (abzone >= a * 3 && abzone < a + 4 * b - 1));
      } else {
        possible = ((abzone >= a * 2) && (abzone < a + b * 3 - 1));
      }
    }
    if (possible) {
      printf("YES");
    } else {
      printf("NO");
    }
    printf("\n");
  }
  return 0;
}
