#include <bits/stdc++.h>
using namespace std;
const long long ool = 1e18 + 9;
const int oo = 1e9 + 9, base = 1e9 + 7;
const double eps = 1e-7;
const int N = 2e6 + 6;
int getType(int a, int b, int x) {
  if (x < b) return 0;
  if (b <= x && x < a) return 1;
  if (a <= x && x < 2 * b) return 2;
  return 3;
}
bool solve(int a, int b, string s) {
  s += 'X';
  int cur = 0;
  vector<int> vec;
  for (int i = 0; i <= (int)s.size() - 1; ++i) {
    if (s[i] == '.')
      ++cur;
    else if (cur) {
      vec.emplace_back(cur);
      cur = 0;
    }
  }
  int bad = 0;
  int cnt = 0;
  for (auto x : vec) {
    int type = getType(a, b, x);
    if (type == 1) return 0;
    if (type == 2) ++cnt;
    if (type == 3) {
      if (bad) return 0;
      bad = x;
    }
  }
  if (!bad) return (cnt & 1);
  for (int i = 0; i <= bad - a; ++i) {
    int x = getType(a, b, i), y = getType(a, b, bad - a - i);
    bool ok = 1;
    for (auto it : {1, 3})
      if (x == it || y == it) ok = 0;
    if (ok && (cnt + (x == 2) + (y == 2)) % 2 == 0) return 1;
  }
  return 0;
}
int main() {
  ios_base ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int T;
  cin >> T;
  while (T--) {
    int a, b;
    string s;
    cin >> a >> b;
    cin >> s;
    bool res = solve(a, b, s);
    cout << (res ? "YES" : "NO") << "\n";
  }
  return 0;
}
