#include <bits/stdc++.h>
using namespace std;
int T, n, a, b, cnt, Ans;
int g[300003], f[300003];
char s[300003];
inline int read() {
  int X = 0, w = 0;
  char ch = 0;
  while (ch < '0' || ch > '9') w |= ch == '-', ch = getchar();
  while (ch >= '0' && ch <= '9')
    X = (X << 3) + (X << 1) + (ch ^ 48), ch = getchar();
  return w ? -X : X;
}
int main() {
  T = read();
  while (T--) {
    a = read();
    b = read();
    scanf("%s", s + 1);
    n = strlen(s + 1);
    int resa = 0, resb = 0, r;
    bool flag = 0;
    Ans = 0;
    for (int l = 1; l <= n; l = r + 1) {
      if (s[l] == 'X') {
        r = l;
        continue;
      }
      int p = l, llen;
      while (p < n && s[p + 1] == '.') p++;
      r = p;
      llen = r - l + 1;
      if (llen < b) continue;
      if (llen >= b && llen < a) {
        Ans = 1;
        break;
      }
      if (llen < 2 * b && llen >= a) {
        resb++;
        continue;
      }
      resa++;
      f[0] = f[1] = f[2] = f[3] = f[4] = f[5] = 0;
      for (int k = 0; k <= llen - a; k++) {
        int ww = llen - a - k;
        if (k >= 2 * b || ww >= 2 * b || (k < a && k >= b) ||
            (ww >= b && ww < a))
          continue;
        int wt = 0;
        if (k >= a) wt++;
        if (ww >= a) wt++;
        f[wt] = 1;
      }
      if (f[0] + f[1] + f[2] == 0) {
        Ans = 1;
        break;
      }
      if ((f[0] | f[2]) + f[1] == 2) {
        flag = 1;
        continue;
      }
      if (f[1]) resb++;
    }
    if (Ans) {
      puts("NO");
      continue;
    }
    if (resa >= 2) {
      puts("NO");
      continue;
    }
    if (flag || (resa + resb) % 2 == 1) {
      puts("YES");
      continue;
    }
    puts("NO");
  }
  return 0;
}
