#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using pairll = pair<ll, ll>;
int main() {
  ll q, a, b, num, cnt, turns;
  string s;
  bool win;
  bool great;
  cin >> q;
  while (q--) {
    turns = 0;
    great = 0;
    cnt = 0;
    win = 1;
    cin >> a >> b;
    cin >> s;
    for (ll i = 0; i < s.length(); i++) {
      if (s[i] == '.') {
        num = 0;
        while (i < s.length() && s[i] == '.') {
          num++;
          i++;
        }
        i--;
        if (a > num && b <= num) {
          win = 0;
        } else if (a <= num && 2 * b + a - 2 >= num) {
          turns++;
          if (num >= 2 * a) {
            great = 1;
          }
        } else if (2 * b + a - 1 <= num && 2 * a > num) {
          win = 0;
        } else if (2 * a <= num && num < a + 3 * b - 1) {
          turns = turns + 2;
          if (num >= 3 * a) {
            great = 1;
          }
        } else if (a + 3 * b - 1 <= num && num < 3 * a) {
          win = 0;
        } else if (3 * a <= num && num < a + 4 * b - 1) {
          turns = turns + 3;
        } else if (a + 4 * b - 1 <= num) {
          win = 0;
        }
        if (2 * b <= num) {
          cnt++;
          if (cnt >= 2) {
            win = 0;
          }
        }
      }
    }
    if (turns % 2 == 0 && !great) {
      win = 0;
    }
    if (!win) {
      puts("NO");
    } else {
      puts("YES");
    }
  }
}
