#include <bits/stdc++.h>
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,abm,mmx,avx,avx2,popcnt,tune=native")
#pragma GCC optimize("fast-math")
#pragma GCC optimize("unroll-loops")
#pragma comment(linker, "/STACK:36777216")
using namespace std;
const long double EPS = 1e-8;
const long double PI = acos(-1);
int mod = (int)998244353;
const int MOD7 = 1000000007;
const int MOD9 = 1000000009;
const int a228 = 18;
const long long kekmod = 1791791791;
const long long bestmod = 1148822869;
vector<long long> mods = {kekmod, bestmod, mod, MOD9, 1000000007};
vector<long long> hashpows = {29, 31, 37, 43, 47, 53, 179, 229};
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count() +
            228 + 'i' + 'q' + 1337 + 1488);
long long MOD = mods[rnd() % mods.size()];
long long hashpow = hashpows[rand() % hashpows.size()];
signed main() {
  ios_base::sync_with_stdio(0);
  cout.tie(0);
  cin.tie(0);
  srand(time(NULL));
  int t;
  cin >> t;
  while (t--) {
    int a, b;
    cin >> a >> b;
    string s;
    cin >> s;
    vector<int> len;
    int cnt = 0;
    s.push_back('X');
    for (int i = 0; i < s.size(); ++i) {
      if (s[i] == '.') {
        cnt++;
      } else {
        if (cnt) len.push_back(cnt);
        cnt = 0;
      }
    }
    int c1 = 0, c2 = 0, c3 = 0;
    for (int i = 0; i < len.size(); ++i) {
      if (len[i] >= b && len[i] < a) {
        c1++;
      } else if (len[i] >= a && len[i] < 2 * b) {
        c2++;
      } else if (len[i] >= 2 * b) {
        c3++;
      }
    }
    if (c1 || c3 > 1) {
      cout << "NO" << '\n';
      continue;
    }
    if (c3 == 0) {
      cout << (c2 % 2 == 0 ? "NO" : "YES") << '\n';
      continue;
    }
    bool kekos = 0;
    int mxx = *max_element((len).begin(), (len).end());
    for (int lft = 0; lft <= mxx - a; ++lft) {
      int x1 = lft, x2 = mxx - lft - a;
      if (x2 >= 2 * b || x1 >= 2 * b || (x1 >= b && x1 < a) ||
          (x2 >= b && x2 < a)) {
        continue;
      }
      bool fs = (x1 >= a && x1 < 2 * b);
      bool ss = (x2 >= a && x2 < 2 * b);
      if ((c2 + fs + ss) % 2 == 0) {
        kekos = 1;
        cout << "YES" << '\n';
        break;
      }
    }
    if (!kekos) {
      cout << "NO" << '\n';
    }
  }
}
