#include <bits/stdc++.h>
using namespace std;
bool solve() {
  int a, b;
  cin >> a >> b;
  string s;
  cin >> s;
  if (s.back() != 'X') s += 'X';
  int n = s.length(), continuous_cnt = 0;
  vector<int> v;
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'X') {
      if (continuous_cnt >= b) {
        v.push_back(continuous_cnt);
      }
      continuous_cnt = 0;
    } else {
      ++continuous_cnt;
    }
  }
  int cnt = 0;
  int max_v = 0;
  for (int vv : v) {
    if (vv < a)
      return false;
    else if (vv < 2 * b)
      ++cnt;
    else {
      if (max_v) {
        return false;
      } else {
        max_v = vv;
      }
    }
  }
  if (max_v) {
    for (int i = 0; i <= max_v - a; ++i) {
      int j = max_v - (i + a);
      if ((b <= i && i < a) || (b <= j && j < a) || 2 * b <= i || 2 * b <= j) {
        continue;
      } else {
        if ((cnt + 1 + ((a <= i) ? 1 : 0) + ((a <= j) ? 1 : 0)) % 2)
          return true;
      }
    }
    return false;
  }
  return cnt % 2;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int q;
  cin >> q;
  while (q--) {
    cout << (solve() ? "YES" : "NO") << endl;
  }
}
