#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void MAX(T &x, T y) {
  if (y > x) x = y;
}
template <class T>
inline void MIN(T &x, T y) {
  if (y < x) x = y;
}
template <class T>
inline void rd(T &x) {
  x = 0;
  char o, f = 1;
  while (o = getchar(), o < 48)
    if (o == 45) f = -f;
  do x = (x << 3) + (x << 1) + (o ^ 48);
  while (o = getchar(), o > 47);
  x *= f;
}
const int M = 3e5 + 5;
int cas, n, a, b, A[M];
char str[M];
int main() {
  rd(cas);
  while (cas--) {
    rd(a), rd(b);
    scanf("%s", str + 1);
    int n = strlen(str + 1);
    str[n + 1] = 'X';
    int cnt1 = 0, cnt2 = 0, cnt3 = 0, len, tmp = 0;
    for (int i = 1; i <= n + 1; i++) {
      if (str[i] == '.')
        tmp++;
      else {
        if (tmp >= b && tmp < a) cnt1++;
        if (tmp >= a && tmp < b + b) cnt2++;
        if (tmp >= b + b) cnt3++, len = tmp;
        tmp = 0;
      }
    }
    if (cnt3 >= 2 || cnt1)
      puts("NO");
    else if (cnt3 == 0)
      puts(cnt2 % 2 ? "YES" : "NO");
    else if (cnt2 % 2)
      puts(len >= 2 * a && len <= a + 3 * b - 2 ? "YES" : "NO");
    else
      puts((len >= a && len <= a + 2 * b - 2 ||
            len >= 3 * a && len <= a + 4 * b - 2)
               ? "YES"
               : "NO");
  }
  return (0 - 0);
}
