#include <bits/stdc++.h>
using namespace std;
int T;
int a, b;
string s;
int main() {
  cin >> T;
  int count = 0;
  while (T--) {
    count++;
    cin >> a >> b;
    cin >> s;
    vector<int> seg;
    int cur = 0;
    char pre = 'X';
    for (char x : s) {
      if (x != pre) {
        if (pre == '.') seg.push_back(cur);
        cur = 1;
      } else {
        cur++;
      }
      pre = x;
    }
    if (pre == '.') seg.push_back(cur);
    if (seg.empty()) {
      cout << "NO\n";
      continue;
    }
    bool canFind = false;
    for (int x : seg) {
      if (x >= b && x < a) {
        canFind = true;
        cout << "NO\n";
        break;
      }
    }
    sort(seg.begin(), seg.end());
    if (canFind) continue;
    bool isWinner = false;
    if (seg.back() >= 4 * b + a) {
      isWinner = false;
    } else {
      isWinner = true;
      int num = 0;
      for (int i = 0; i < (int)seg.size() - 1; i++) {
        if (seg[i] >= a) num++;
        if (seg[i] >= 2 * b) isWinner = false;
      }
      int len = seg.back() - a;
      if (seg.back() >= a) num++;
      bool canAdd1 = false, canSub1 = false, canAdd0 = false;
      if (isWinner) {
        bool canFound = false;
        for (int p1 = 0; p1 <= len; p1++) {
          int p2 = len - p1;
          if (p1 < 2 * b && p2 < 2 * b) {
            int canAdd = (p1 >= a) + (p2 >= a) - 1;
            if ((p1 >= b && p1 < a) || (p2 >= b && p2 < a)) continue;
            canFound = true;
            if (canAdd == 1) canAdd1 = true;
            if (canAdd == -1) canSub1 = true;
            if (canAdd == 0) canAdd0 = true;
          }
        }
        if (!canFound)
          isWinner = false;
        else if (num % 2 == 0 && canAdd0 == false)
          isWinner = false;
        else if (num % 2 == 1 && canSub1 == false && canAdd1 == false)
          isWinner = false;
      }
    }
    if (isWinner)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
