#include <bits/stdc++.h>
using namespace std;
const int INF = 1061109567;
const long long LINF = 4557430888798830399ll;
char s[300005];
int x[300005], xtop;
void TestCase() {
  xtop = 0;
  int a, b;
  scanf("%d%d", &a, &b);
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  int cur = 0;
  for (int i = 1; i <= n; ++i) {
    if (s[i] == 'X') {
      if (cur) {
        x[++xtop] = cur;
        cur = 0;
      }
    } else
      ++cur;
  }
  if (cur) {
    x[++xtop] = cur;
    cur = 0;
  }
  if (a >= 2 * b) {
    int cnt_type4 = 0, len = 0;
    for (int i = 1; i <= xtop; ++i) {
      if (x[i] < b)
        continue;
      else if (b <= x[i] && x[i] < a) {
        puts("NO");
        return;
      } else if (a <= x[i]) {
        ++cnt_type4;
        len = x[i];
        if (cnt_type4 >= 2) {
          puts("NO");
          return;
        }
      } else
        exit(-1);
    }
    if (cnt_type4 == 1) {
      for (int i = 1; i <= len - a + 1; ++i) {
        int len1 = i - 1, len2 = len - (i + a - 1);
        if (b <= len1 || b <= len2) continue;
        puts("YES");
        return;
      }
      puts("NO");
      return;
    } else {
      puts("NO");
      return;
    }
  } else {
    int cnt_type3 = 0, cnt_type4 = 0, len = 0;
    for (int i = 1; i <= xtop; ++i) {
      if (x[i] < b) continue;
      if (b <= x[i] && x[i] < a) {
        puts("NO");
        return;
      } else if (a <= x[i] && x[i] < 2 * b)
        ++cnt_type3;
      else if (2 * b <= x[i]) {
        ++cnt_type4;
        len = x[i];
        if (cnt_type4 >= 2) {
          puts("NO");
          return;
        }
      }
    }
    if (cnt_type4 == 1) {
      for (int i = 1; i <= len - a + 1; ++i) {
        int len1 = i - 1, len2 = len - (i + a - 1);
        if ((b <= len1 && len1 < a) || (b <= len2 && len2 < a)) continue;
        if (2 * b <= len1 || 2 * b <= len2) continue;
        int tmp1 = 0, tmp2 = 0;
        if (a <= len1 && len1 < 2 * b) tmp1 = 1;
        if (a <= len2 && len2 < 2 * b) tmp2 = 1;
        if ((cnt_type3 + tmp1 + tmp2) % 2 == 0) {
          puts("YES");
          return;
        }
      }
      puts("NO");
      return;
    } else {
      if (cnt_type3 % 2 == 1) {
        puts("YES");
        return;
      } else {
        puts("NO");
        return;
      }
    }
  }
  exit(-1);
}
int main() {
  int t = 1;
  scanf("%d", &t);
  for (int i = 1; i <= t; ++i) {
    TestCase();
  }
  return 0;
}
