#include <bits/stdc++.h>
using namespace std;
const int maxn = 300000 + 100;
const int maxm = 2000000 + 100;
const int maxt = 3000000 + 100;
const int maxk = 10 + 3;
const long long unit = 1LL;
const int INF = 0x3f3f3f3f;
const long long Inf = 0x3f3f3f3f3f3f3f3fLL;
const double eps = 1e-3;
const double inf = 1e15;
const double pi = acos(-1.0);
const long long mod = 1000000007LL;
inline long long read() {
  long long x = 0;
  bool t = false;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') t = true, ch = getchar();
  while (ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
  return t ? -x : x;
}
int a, b;
char str[maxn];
int main() {
  int T;
  T = read();
  while (T--) {
    a = read(), b = read();
    scanf("%s", str + 1);
    int n = strlen(str + 1);
    bool ok = true;
    int cnt = 0, cnt1 = 0, x = 0;
    for (int i = 1; i <= n; ++i) {
      if (str[i] == '.') {
        int j = i;
        while (j <= n && str[j] == '.') ++j;
        --j;
        int len = j - i + 1;
        if (len < b) continue;
        if ((len < a) || (a + 4 * b - 1 <= len)) {
          ok = false;
          break;
        }
        if (a <= len && len < b + b) ++cnt1;
        if (len >= b + b && len >= a) ++cnt, x = len;
        i = j;
      }
    }
    if (!ok || (cnt >= 2)) {
      printf("NO\n");
      continue;
    }
    if (cnt == 0) {
      if (cnt1 & 1)
        printf("YES\n");
      else
        printf("NO\n");
    } else {
      ok = false;
      for (int l = 0; l <= x && l < 2 * b; ++l) {
        if (b <= l && l < a) continue;
        int r = x - l - a;
        if (b <= r && r < a) continue;
        if (r < 0) break;
        if (r >= 2 * b) continue;
        int tmp = cnt1;
        if (a <= l) ++tmp;
        if (a <= r) ++tmp;
        if (!(tmp & 1)) {
          ok = true;
          break;
        }
      }
      if (ok)
        printf("YES\n");
      else
        printf("NO\n");
    }
  }
  return 0;
}
