#include <bits/stdc++.h>
using namespace std;
char s[300000 + 5];
int c[5];
vector<int> four;
int main() {
  int CAS;
  scanf("%d", &CAS);
  while (CAS--) {
    int a, b;
    scanf("%d%d", &a, &b);
    scanf("%s", s + 1);
    int n = strlen(s + 1);
    for (int i = 1; i <= 4; i++) c[i] = 0;
    four.clear();
    int last = 0;
    for (int i = 1; i <= n + 1; i++) {
      if (s[i] != '.') {
        if (i - last - 1) {
          int l = i - last - 1;
          if (l < b)
            c[1]++;
          else if (l < a)
            c[2]++;
          else if (l < b * 2)
            c[3]++;
          else
            c[4]++, four.push_back(l);
        }
        last = i;
      }
    }
    if (c[2] || c[4] > 1)
      puts("NO");
    else if (c[4] == 0)
      puts(c[3] & 1 ? "YES" : "NO");
    else {
      int l = four[0];
      int v[2] = {};
      for (int c = 0; c <= l - a; c++) {
        int d = l - a - c;
        if (b <= c && c < a || c >= b * 2 || b <= d && d < a || d >= b * 2)
          continue;
        int cnt = 0;
        if (a <= c && c < b * 2) cnt++;
        if (a <= d && d < b * 2) cnt++;
        v[cnt & 1] = 1;
      }
      if (v[0] && v[1])
        puts("YES");
      else if (v[1] && c[3] & 1)
        puts("YES");
      else if (v[0] && (c[3] & 1) == 0)
        puts("YES");
      else
        puts("NO");
    }
  }
  return 0;
}
