#include <bits/stdc++.h>
using namespace std;
int T, A, B;
string s;
int main() {
  cin.sync_with_stdio(false);
  cin >> T;
  while (T--) {
    cin >> A >> B;
    cin >> s;
    vector<int> v;
    int nr = 0;
    int nrb = 0;
    for (int i = 0; i < (int)(s).size(); ++i) {
      if (s[i] == '.') ++nr;
      if (nr && (s[i] == 'X' || i + 1 == (int)(s).size())) {
        if (nr >= B) {
          v.push_back(nr);
        }
        nr = 0;
      }
    }
    sort(v.begin(), v.end());
    for (auto x : v) {
      if (x >= 2 * B) {
        ++nrb;
      }
    }
    if ((int)(v).size() == 0) {
      cout << "NO\n";
    } else if (v[0] < A) {
      cout << "NO\n";
    } else if (nrb >= 2) {
      cout << "NO\n";
    } else if (nrb == 0) {
      if ((int)(v).size() % 2 == 1) {
        cout << "YES\n";
      } else {
        cout << "NO\n";
      }
    } else {
      int mmax = v[(int)(v).size() - 1];
      int ok = 0;
      for (int i = 0; i <= mmax - A; ++i) {
        int l = i;
        int r = mmax - (i + A);
        if (l >= 2 * B || r >= 2 * B) {
          continue;
        }
        if (l >= B && l < A) continue;
        if (r >= B && r < A) continue;
        int nr = (int)(v).size() - 1;
        if (l >= A) ++nr;
        if (r >= A) ++nr;
        if (nr % 2 == 0) ok = 1;
      }
      if (ok)
        cout << "YES\n";
      else
        cout << "NO\n";
    }
  }
}
