#include <bits/stdc++.h>
using namespace std;
int main() {
  FILE *fin = stdin;
  FILE *fout = stdout;
  int t, a, b, s1, s2, s3, s4, curr, maxi, ok, i;
  char c;
  fscanf(fin, "%d\n", &t);
  for (; t; t--) {
    fscanf(fin, "%d%d\n", &a, &b);
    s1 = s2 = s3 = s4 = 0;
    maxi = 0;
    c = fgetc(fin);
    curr = 0;
    while (c == 'X' || c == '.') {
      if (c == 'X') {
        if (curr) {
          if (curr < b)
            s1++;
          else if (curr < a)
            s2++;
          else if (curr < 2 * b)
            s3++;
          else
            s4++;
          maxi = max(maxi, curr);
        }
        curr = 0;
      } else
        curr++;
      c = fgetc(fin);
    }
    if (curr) {
      if (curr < b)
        s1++;
      else if (curr < a)
        s2++;
      else if (curr < 2 * b)
        s3++;
      else
        s4++;
      maxi = max(maxi, curr);
    }
    if (s2) {
      fprintf(fout, "NO\n");
    } else {
      if (s4 > 1)
        fprintf(fout, "NO\n");
      else if (s4 == 0) {
        if (s3 % 2 == 1)
          fprintf(fout, "YES\n");
        else
          fprintf(fout, "NO\n");
      } else {
        ok = 0;
        for (i = 1; i + a - 1 <= maxi; i++) {
          curr = i - 1;
          s4--;
          if (curr) {
            if (curr < b)
              s1++;
            else if (curr < a)
              s2++;
            else if (curr < 2 * b)
              s3++;
            else
              s4++;
          }
          curr = maxi - (i + a - 1);
          if (curr) {
            if (curr < b)
              s1++;
            else if (curr < a)
              s2++;
            else if (curr < 2 * b)
              s3++;
            else
              s4++;
          }
          if (!ok) {
            if (!s2 && s3 % 2 == 0 && s4 == 0) ok = 1;
          }
          curr = i - 1;
          if (curr) {
            if (curr < b)
              s1--;
            else if (curr < a)
              s2--;
            else if (curr < 2 * b)
              s3--;
            else
              s4--;
          }
          curr = maxi - (i + a - 1);
          if (curr) {
            if (curr < b)
              s1--;
            else if (curr < a)
              s2--;
            else if (curr < 2 * b)
              s3--;
            else
              s4--;
          }
          s4++;
        }
        if (!ok)
          fprintf(fout, "NO\n");
        else
          fprintf(fout, "YES\n");
      }
    }
  }
  return 0;
}
