#include <bits/stdc++.h>
using namespace std;
int a, b;
char s[300005];
vector<int> v;
int judge(int x) {
  if (x >= b && x < a) return 0;
  if (x >= a && x < (b << 1)) return 1;
  if (x >= (b << 1)) return 2;
  return -1;
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    v.clear();
    scanf("%d %d", &a, &b);
    scanf("%s", s);
    int tot = 0;
    for (int i = 0; s[i]; ++i)
      if (s[i] == '.') {
        ++tot;
        if (s[i + 1] != '.') {
          v.push_back(tot);
          tot = 0;
        }
      }
    int cnt[3] = {0};
    int tmp;
    for (int i : v) {
      int type = judge(i);
      if (type != -1) ++cnt[type];
      if (type == 2) tmp = i;
    }
    if (cnt[0] || cnt[2] > 1)
      printf("NO\n");
    else if (cnt[2]) {
      char flag = 0;
      for (int i = 0; i <= tmp - a; ++i) {
        int type1 = judge(i), type2 = judge(tmp - i - a);
        if (type1 == 0 || type2 == 0 || type1 == 2 || type2 == 2) continue;
        if (((cnt[1] + (type1 == 1) + (type2 == 1)) & 1) == 0) {
          flag = 1;
          break;
        }
      }
      printf("%s\n", flag ? "YES" : "NO");
    } else
      printf("%s\n", cnt[1] & 1 ? "YES" : "NO");
  }
  return 0;
}
