#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int q;
  cin >> q;
  while (q--) {
    bool ans = 0;
    vector<int> v;
    int a, b;
    cin >> a >> b;
    string str;
    cin >> str;
    int len = str.size();
    int cnt = 0;
    for (int i = 0; i < len; i++) {
      if (str[i] == '.') {
        ++cnt;
      } else if (cnt) {
        v.push_back(cnt);
        cnt = 0;
      }
    }
    if (cnt) v.push_back(cnt);
    cnt = 0;
    bool f = 0;
    for (auto it : v) {
      if (it >= 2 * b) ++cnt;
      if (it >= b && it < a) f = 1;
    }
    if (f || cnt >= 2) {
      ans = 0;
    } else if (cnt == 0) {
      for (auto it : v) {
        if (it >= a) ++cnt;
      }
      if (cnt & 1) {
        ans = 1;
      } else {
        ans = 0;
      }
    } else {
      int mxp = max_element(v.begin(), v.end()) - v.begin();
      int mx = v[mxp];
      cnt = 0;
      for (auto it : v) {
        if (it != mx && it >= a) {
          ++cnt;
        }
      }
      for (int l = 1; l + a - 1 <= mx; l++) {
        int r = l + a - 1;
        int lft = l - 1, rgt = mx - r;
        if ((rgt >= b && rgt < a) || (lft >= b && lft < a)) continue;
        if (lft >= 2 * b || rgt >= 2 * b) continue;
        int tmp = cnt + (lft >= a) + (rgt >= a);
        if (!(tmp & 1)) {
          ans = 1;
        }
      }
    }
    cout << (ans ? "YES" : "NO") << endl;
  }
  return 0;
}
