#include <bits/stdc++.h>
using namespace std;
int caseNum = 0;
int a = 0, b = 0;
int main() {
  scanf("%d", &caseNum);
  while (caseNum--) {
    scanf("%d %d\n", &a, &b);
    char c = '\0';
    int n = 0;
    vector<int> resource;
    while (true) {
      scanf("%c", &c);
      if (c == '.') {
        n++;
      } else {
        if (n != 0) {
          if (n >= b) resource.push_back(n);
          n = 0;
        }
        if (c == '\n') break;
      }
    }
    sort(resource.begin(), resource.end());
    int counter1 = 0, counter2 = 0, counter3 = 0;
    for (int i = 0; i < resource.size(); i++) {
      if (resource[i] < a) counter1++;
      if (a <= resource[i] && resource[i] < 2 * b) counter2++;
      if (resource[i] >= 2 * b) counter3++;
    }
    int max = resource.size() - 1;
    if (counter1 || counter3 >= 2) {
      printf("NO\n");
      continue;
    }
    if (!counter3) {
      if (counter2 % 2 == 1)
        printf("YES\n");
      else
        printf("NO\n");
      continue;
    }
    if (counter2 % 2 == 1) {
      if (2 * a <= resource[max] && resource[max] <= 3 * b + a - 2) {
        printf("YES\n");
        continue;
      }
    }
    if (counter2 % 2 == 0) {
      if (resource[max] <= a + 2 * b - 2) {
        printf("YES\n");
        continue;
      }
      if (3 * a <= resource[max] && resource[max] <= a + 4 * b - 2) {
        printf("YES\n");
        continue;
      }
    }
    printf("NO\n");
  }
}
