#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long q;
  cin >> q;
  for (long long u = 0; u < q; u++) {
    bool b1 = false;
    long long a, b;
    cin >> a >> b;
    string s;
    cin >> s;
    vector<long long> dop;
    long long kol = 0;
    for (long long c = 0; c < s.size(); c++) {
      if (s[c] == '.')
        kol++;
      else {
        if (kol == 0) continue;
        dop.push_back(kol);
        kol = 0;
      }
    }
    if (kol > 0) {
      dop.push_back(kol);
    }
    sort(dop.begin(), dop.end());
    reverse(dop.begin(), dop.end());
    if (dop.size() == 0 || dop[0] < a) {
      b1 = true;
    } else {
      dop[0] -= a;
      dop[0] = max(0ll, dop[0] - (b - 1));
      sort(dop.begin(), dop.end());
      reverse(dop.begin(), dop.end());
      if (dop[0] >= b * 2) {
        b1 = true;
      } else {
        long long e = 0, e1 = 0;
        for (auto i : dop) {
          if (i >= b && i < a) {
            e++;
          }
          if (i >= a) e1++;
        }
        if (e) {
          b1 = true;
        } else {
          if (e1 % 2)
            b1 = true;
          else
            cout << "YES\n";
        }
      }
    }
    if (b1) {
      b1 = false;
      vector<long long> dop;
      long long kol = 0;
      for (long long c = 0; c < s.size(); c++) {
        if (s[c] == '.')
          kol++;
        else {
          if (kol == 0) continue;
          dop.push_back(kol);
          kol = 0;
        }
      }
      if (kol > 0) {
        dop.push_back(kol);
      }
      sort(dop.begin(), dop.end());
      reverse(dop.begin(), dop.end());
      if (dop.size() == 0 || dop[0] < a) {
        b1 = true;
      } else {
        dop[0] -= a;
        if (2 * b + 2 * b - 1 <= dop[0]) {
          b1 = true;
        }
        if (!b1) {
          if (dop[0] >= 2 * b) {
            dop.push_back(dop[0] - (2 * b - 1));
            dop[0] = 2 * b - 1;
          }
          sort(dop.begin(), dop.end());
          reverse(dop.begin(), dop.end());
          if (dop[0] >= b * 2) {
            b1 = true;
          } else {
            long long e = 0, e1 = 0;
            for (auto i : dop) {
              if (i >= b && i < a) {
                e++;
              }
              if (i >= a) e1++;
            }
            if (e) {
              b1 = true;
            } else {
              if (e1 % 2)
                b1 = true;
              else
                cout << "YES\n";
            }
          }
        }
      }
    }
    if (b1) {
      b1 = false;
      vector<long long> dop;
      long long kol = 0;
      for (long long c = 0; c < s.size(); c++) {
        if (s[c] == '.')
          kol++;
        else {
          if (kol == 0) continue;
          dop.push_back(kol);
          kol = 0;
        }
      }
      if (kol > 0) {
        dop.push_back(kol);
      }
      sort(dop.begin(), dop.end());
      reverse(dop.begin(), dop.end());
      if (dop.size() == 0 || dop[0] < a) {
        cout << "NO\n";
      } else {
        dop[0] -= a;
        dop.push_back(dop[0] / 2);
        dop[0] = dop[0] - dop[0] / 2;
        sort(dop.begin(), dop.end());
        reverse(dop.begin(), dop.end());
        if (dop[0] >= b * 2) {
          cout << "NO\n";
        } else {
          long long e = 0, e1 = 0;
          for (auto i : dop) {
            if (i >= b && i < a) {
              e++;
            }
            if (i >= a) e1++;
          }
          if (e) {
            cout << "NO\n";
          } else {
            if (e1 % 2)
              cout << "NO\n";
            else
              cout << "YES\n";
          }
        }
      }
    }
  }
  return 0;
}
