#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 9999;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int a, b, cnt = 0;
    string s;
    char last = 'X';
    vector<int> num;
    cin >> a >> b >> s;
    for (auto x : s) {
      if (x == 'X' && last == '.') {
        if (cnt >= min(a, b)) num.push_back(cnt);
        cnt = 0;
      }
      if (x == '.') ++cnt;
      last = x;
    }
    if (cnt >= min(a, b)) num.push_back(cnt);
    sort(num.begin(), num.end());
    reverse(num.begin(), num.end());
    if (a < b) {
      if (num.size() % 2)
        cout << "yes\n";
      else if (num.size() && (num[0] >= 2 * a || num.back() < b))
        cout << "yes\n";
    } else if (a < b)
      cout << "no\n";
    else if (a > b) {
      if (!num.size() || num.back() < a || num[0] >= a + 4 * b - 1)
        cout << "no\n";
      else if (num.size() > 1 && num[0] >= 2 * b && num[1] >= 2 * b)
        cout << "no\n";
      else if (num[0] < 2 * b && num.size() % 2)
        cout << "yes\n";
      else if (num[0] < 2 * b)
        cout << "no\n";
      else if (num.size() % 2 && num[0] < a + 2 * b - 1)
        cout << "yes\n";
      else if (num.size() % 2 && num[0] < 3 * a)
        cout << "no\n";
      else if (num.size() % 2)
        cout << "yes\n";
      else if (a >= 2 * b)
        cout << "no\n";
      else if (num[0] < 2 * a)
        cout << "no\n";
      else if (num[0] < a + 3 * b - 1)
        cout << "yes\n";
      else
        cout << "no\n";
    } else {
      int k = 0;
      for (auto x : num) {
        if (x != (3 * a - 1)) ++k;
      }
      if (k % 2)
        cout << "yes\n";
      else
        cout << "no\n";
    }
  }
  return 0;
}
