#include <bits/stdc++.h>
using namespace std;
const long long N = 300111;
long long a, b;
string s;
long long l1, l2, l3, l4;
long long len = 0;
long long type(long long sz) {
  if (sz >= b && sz < a) {
    return 2;
  }
  if (sz >= a && sz < 2 * b) {
    return 3;
  }
  if (sz >= 2 * b) {
    return 4;
  }
  return 1;
}
void check(long long x) {
  long long t = type(x);
  if (t == 2) {
    l2++;
  }
  if (t == 3) {
    l3++;
  }
  if (t == 4) {
    l4++;
    len = x;
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long q;
  cin >> q;
  for (long long j = 1; j <= q; j++) {
    cin >> a >> b;
    cin >> s;
    l1 = l2 = l3 = l4 = 0;
    s = s + "X";
    long long sz = 0;
    for (long long i = 0; i < s.size(); i++) {
      if (s[i] != 'X') {
        sz++;
      } else {
        check(sz);
        sz = 0;
      }
    }
    if (l2 > 0 || l4 > 1) {
      cout << "NO"
           << "\n";
      continue;
    }
    if (l4 == 0) {
      if (l3 % 2 == 0) {
        cout << "NO"
             << "\n";
      } else {
        cout << "YES"
             << "\n";
      }
      continue;
    }
    long long m = len;
    long long l31 = l3;
    if (l4 == 1) {
      l1 = l2 = l3 = l4 = 0;
      l3 = l31;
      bool fl = 0;
      for (long long i = a; i <= m; i++) {
        long long l = i - a;
        long long r = m - i;
        check(l);
        check(r);
        if (l2 == 0 && l4 == 0 && l3 % 2 == 0) {
          fl = 1;
          break;
        }
        l1 = l2 = l3 = l4 = 0;
        l3 = l31;
      }
      if (fl) {
        cout << "YES"
             << "\n";
      } else {
        cout << "NO"
             << "\n";
      }
    }
  }
  return 0;
}
