#include <bits/stdc++.h>
using namespace std;
void A() { cout << "YES" << endl; }
void B() { cout << "NO" << endl; }
int main() {
  int t;
  cin >> t;
  while (t--) {
    vector<int> v;
    int a, b;
    cin >> a >> b;
    string s;
    cin >> s;
    int cnt = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '.') {
        cnt++;
      } else {
        if (cnt) {
          v.push_back(cnt);
          cnt = 0;
        }
      }
    }
    if (cnt) {
      v.push_back(cnt);
      cnt = 0;
    }
    int f = 0;
    int len;
    for (int i = 0; i < v.size(); i++) {
      if (v[i] >= 2 * b) cnt++, len = v[i];
      if (v[i] >= b && v[i] < a) {
        f = 1;
      }
    }
    if (f || cnt >= 2) {
      B();
      continue;
    }
    if (cnt == 0) {
      for (int i = 0; i < v.size(); i++) {
        if (v[i] >= a) ++cnt;
      }
      if (cnt & 1)
        A();
      else
        B();
      continue;
    }
    cnt = 0;
    for (int i = 0; i < v.size(); i++) {
      if (v[i] >= a && v[i] != len) {
        cnt++;
      }
    }
    int flag = 0;
    for (int l = 1; l + a - 1 <= len; l++) {
      int r = l + a - 1;
      int left = l - 1, right = len - r;
      if (left >= 2 * b || right >= 2 * b) continue;
      if ((left >= b && left < a) || (right >= b && right < a)) {
        continue;
      }
      int temp = cnt + (left >= a) + (right >= a);
      if (temp % 2 == 0) {
        flag = 1;
        A();
        break;
      }
    }
    if (!flag) {
      B();
    }
  }
  return 0;
}
