#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    ;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return x;
}
bool fl;
inline int Get() {
  int x = 0;
  char ch = getchar();
  for (; ch == '.'; ch = getchar()) x++;
  if (ch == '\n') fl = 1;
  return x;
}
int Q, a, b, now;
inline bool solve() {
  a = read(), b = read();
  int BA = 0, BB = 0, DB = 0, mx = 0;
  for (fl = 0; !fl;)
    now = Get(), BA += now >= a, BB += now >= b, DB += now >= b * 2,
    mx = max(mx, now);
  if (BB > BA) return 0;
  if (a >= 2 * b) return BA == 1 && mx <= a + 2 * b - 2;
  if (mx > a + 4 * b - 2 || DB > 1) return 0;
  if (DB)
    return ((BA & 1) && (mx >= 3 * a || mx <= a + 2 * b - 2)) ||
           (!(BA & 1) && mx >= 2 * a && mx <= a + 3 * b - 2);
  return BA & 1;
}
int main() {
  for (Q = read(); Q; Q--) puts(solve() ? "YES" : "NO");
  return 0;
}
