#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
const int N = 1e6 + 10;
const int M = 1e9 + 7;
const int inf = 1e9 + 7;
const ll INF = 1e18;
int d[3];
int a, b;
int n;
void add(int len, int val) {
  if (b <= len && len < a) {
    d[0] += val;
  } else if (a <= len && len < b + b) {
    d[1] += val;
  } else if (b + b <= len) {
    d[2] += val;
  }
}
bool check() { return (d[0] > 0) || (d[2] > 0) || (d[1] > 0 && d[1] & 1); }
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int q;
  cin >> q;
  while (q--) {
    d[0] = d[1] = d[2] = 0;
    string s;
    cin >> a >> b;
    cin >> s;
    s = s + 'X';
    int z = 0;
    vector<int> num;
    for (const char& x : s) {
      if (x == 'X') {
        add(z, 1);
        if (z >= a) {
          num.push_back(z);
        }
        z = 0;
      } else {
        z++;
      }
    }
    int f = 1;
    for (const int& x : num) {
      add(x, -1);
      for (int j = 0; j + a <= x; j++) {
        int k = x - a - j;
        add(j, 1);
        add(k, 1);
        f &= check();
        add(j, -1);
        add(k, -1);
      }
      add(x, 1);
    }
    if (!f) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
}
