#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 5;
char s[maxn];
int A[maxn];
int cnt;
int main() {
  int T;
  cin >> T;
  int a, b;
  while (T--) {
    scanf("%d%d", &a, &b);
    scanf("%s", s);
    int len = strlen(s);
    cnt = 0;
    int num = 0;
    for (int i = 0; i < len; i++) {
      if (s[i] == '.') {
        num++;
      } else {
        A[++cnt] = num;
        num = 0;
      }
    }
    if (num) A[++cnt] = num;
    int c = 0;
    int flag = 0;
    int f = 0, p = 0;
    for (int i = 1; i <= cnt; i++) {
      if (A[i] >= b && A[i] < a) {
        flag = 1;
        break;
      }
      if (A[i] >= 2 * b) {
        p = A[i];
        f++;
        if (f > 1) {
          flag = 1;
          break;
        }
      }
      if (A[i] >= a && A[i] < 2 * b) {
        c++;
      }
    }
    if (flag)
      puts("NO");
    else {
      if (p) {
        int flag = 0;
        for (int i = 0; i + a <= p; i++) {
          if (i >= 2 * b || (b <= i && i < a)) {
            continue;
          }
          int t = p - i - a;
          if (t >= 2 * b || (b <= t && t < a)) {
            continue;
          }
          int t1 = (i >= a && i < 2 * b);
          int t2 = (t >= a && t < 2 * b);
          if ((c + t1 + t2) % 2 == 0) {
            flag = 1;
            break;
          }
        }
        puts(flag ? "YES" : "NO");
      } else {
        if (c & 1)
          puts("YES");
        else
          puts("NO");
      }
    }
  }
  return 0;
}
