#include <bits/stdc++.h>
using namespace std;
const int maxn = 300030;
int T, a, b, g[maxn], cnt, len;
string s;
bool cmp(int a, int b) { return a > b; }
bool check() {
  int bg = 0, wx = 0, jl = 0;
  if (g[1] < a) return false;
  for (int i = 1; i <= cnt; i++) {
    if (g[i] >= b && g[i] < a) return false;
    if (g[i] >= 2 * b) wx++;
    if (g[i] >= a) jl++;
  }
  if (wx > 1) return false;
  jl--;
  if (g[1] >= 4 * b + a - 1) return false;
  int la = g[1] - a;
  if (jl % 2 == 0) {
    if (la >= 2 * a) return true;
    if (la <= 2 * b - 2) return true;
    return false;
  } else {
    if (la < a) return false;
    if (la - a < b) return true;
    int l = la - (b - 1);
    if (l >= a && l < 2 * b) return true;
    return false;
  }
}
int main() {
  cin >> T;
  while (T--) {
    cin >> a >> b >> s;
    len = s.length();
    int nl = 0;
    cnt = 0;
    for (int i = 0; i < len; i++) {
      if (s[i] == '.')
        nl++;
      else {
        if (nl > 0) g[++cnt] = nl;
        nl = 0;
      }
    }
    if (nl > 0) g[++cnt] = nl;
    sort(g + 1, g + cnt + 1, cmp);
    puts(check() ? "YES" : "NO");
  }
  return 0;
}
