#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int T;
  cin >> T;
  while (T--) {
    int a, b;
    cin >> a >> b;
    string str;
    cin >> str;
    str += 'X';
    int ok = 1, k = -1, count = 0;
    for (int i = 0, c = 0; i < str.size(); i++)
      if (str[i] == '.') {
        c++;
      } else {
        if (c >= b && c < a) ok = 0;
        if (c >= 2 * b) {
          if (k < 0)
            k = c;
          else
            ok = false;
        }
        if (c >= a && c < 2 * b) count++;
        c = 0;
      }
    if (ok) {
      if (k < 0) {
        if (count % 2 == 0) ok = 0;
      } else {
        ok = 0;
        for (int r1 = 0; k - a - r1 >= 0; r1++) {
          int r2 = k - a - r1, nc = count;
          if ((r1 >= 2 * b) || (b <= r1 && r1 < a)) continue;
          if ((r2 >= 2 * b) || (b <= r2 && r2 < a)) continue;
          if (r1 >= a) ++nc;
          if (r2 >= a) ++nc;
          if (nc % 2 == 0) ok = 1;
        }
      }
    }
    cout << (ok ? "YES" : "NO") << endl;
  }
  return 0;
}
