#include <bits/stdc++.h>
using namespace std;
int q, b, a;
string s;
int mex(set<int>& ss) {
  int cnt = 0;
  while (ss.find(cnt) != ss.end()) {
    cnt++;
  }
  return cnt;
}
int main() {
  cin >> q;
  while (q--) {
    cin >> a >> b >> s;
    int n = s.size();
    vector<int> v;
    int cnt = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == 'X' && cnt) {
        v.push_back(cnt);
        cnt = 0;
      } else if (s[i] == '.') {
        cnt++;
      }
    }
    if (cnt) {
      v.push_back(cnt);
    }
    bool moze = true;
    int index = -1;
    cnt = 0;
    n = v.size();
    if (n == 0) {
      cout << "NO\n";
      continue;
    }
    for (int i = 0; i < n; i++) {
      if (v[i] < b) continue;
      if (b <= v[i] && v[i] < a) {
        moze = false;
        break;
      }
      if (b + b <= v[i]) {
        if (index != -1) {
          moze = false;
          break;
        } else
          index = i;
      }
      if (a <= v[i] && v[i] < b + b) {
        cnt++;
      }
    }
    if (moze == false) {
      cout << "NO\n";
      continue;
    }
    if (index == -1) {
      if (cnt & 1)
        cout << "YES\n";
      else
        cout << "NO\n";
      continue;
    }
    n = v[index];
    moze = false;
    for (int i = 0; i + a <= n; i++) {
      int levo = i;
      int desno = n - i - a;
      if (levo >= b + b || (b <= levo && levo < a)) continue;
      if (desno >= b + b || (b <= desno && desno < a)) continue;
      int tempcnt = cnt;
      if (levo >= a) tempcnt++;
      if (desno >= a) tempcnt++;
      if (tempcnt % 2 == 0) moze = true;
    }
    if (moze)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
