#include <bits/stdc++.h>
using namespace std;
string s;
int a, b;
void game() {
  int n2 = 0, n3 = 0, n4 = 0, l, cnt = 0;
  for (int i = 0; i <= s.length() && !n2 && n4 < 2; i++) {
    if (i < s.length() && s[i] == '.')
      cnt++;
    else {
      if (cnt >= b && cnt < a)
        n2++;
      else if (cnt >= a && cnt < 2 * b)
        n3++;
      else if (cnt >= 2 * b) {
        n4++;
        l = cnt;
      }
      cnt = 0;
    }
  }
  bool _11 = l >= 2 * b && l <= (a + 2 * b - 2);
  bool _13 = l >= 2 * a && l < (a + 3 * b - 1);
  bool _33 = l >= 3 * a && l <= (a + 4 * b - 2);
  if (n2 || n4 > 1)
    cout << "NO\n";
  else if ((!(n3 & 1) && (_11 || _33)) || (n3 & 1 && (!n4 || _13)))
    cout << "YES\n";
  else
    cout << "NO\n";
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  int q;
  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> a >> b;
    cin >> s;
    game();
  }
  return 0;
}
