#include <bits/stdc++.h>
using namespace std;
int q, a, b, len;
int cnta, cntb, cnt1, cnt, maxx;
const int N = 300010;
char str[N];
int main() {
  scanf("%d", &q);
  while (q--) {
    maxx = cnta = cntb = cnt1 = cnt = 0;
    scanf("%d%d%s", &a, &b, (str + 1));
    len = strlen(str + 1);
    str[len + 1] = 'X';
    for (int i = 1; i <= len + 1; i++) {
      if (str[i] == '.')
        cnt++;
      else {
        if (cnt >= a) cnta++;
        if (cnt >= b) cntb++;
        if (cnt >= 2 * b) cnt1++;
        maxx = max(cnt, maxx);
        cnt = 0;
      }
    }
    if (cnta < cntb) {
      printf("NO\n");
      continue;
    }
    if (cnt1 >= 2) {
      printf("NO\n");
      continue;
    } else {
      if (cnt1 == 1) {
        int flag = 0;
        for (int i = 0; i <= maxx - a; i++) {
          int l = i;
          int r = maxx - a - i;
          if (l >= 2 * b || r >= 2 * b) continue;
          if ((l >= b && l < a) || (r >= b && r < a)) continue;
          int temp = 0;
          if (l >= a) temp++;
          if (r >= a) temp++;
          if ((cnta + temp - 1) % 2 == 0) {
            flag = 1;
            break;
          }
        }
        if (flag)
          printf("YES\n");
        else
          printf("NO\n");
      } else {
        if (cnta % 2) {
          printf("YES\n");
        } else
          printf("NO\n");
      }
    }
  }
}
