#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 10;
char s[maxn];
string solve() {
  int a, b;
  scanf("%d%d%s", &a, &b, s + 1);
  int n = strlen(s + 1);
  s[n + 1] = 'X';
  s[n + 2] = '\0';
  int mx = 0, A = 0, B = 0, BB = 0, cnt = 0;
  for (int i = 1; s[i]; i++)
    if (s[i] == '.')
      cnt++;
    else {
      mx = max(mx, cnt);
      if (cnt >= b) B++;
      if (cnt >= a) A++;
      if (cnt >= 2 * b) BB++;
      cnt = 0;
    }
  if (B > A || BB >= 2 || mx >= a + b * 4 - 1) return "NO";
  if (mx < a + b) {
    if (B & 1) return "YES";
    return "NO";
  }
  if (B & 1) {
    if (mx < a + 2 * b - 1 || (mx >= 3 * a && mx <= 3 * a + 2 * b - 2))
      return "YES";
    return "NO";
  } else {
    if (mx >= 2 * a && mx <= a + 3 * b - 2) return "YES";
    return "NO";
  }
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) cout << solve() << '\n';
}
