Problem: Several years ago Tolya had n computer games and at some point of time he decided to burn them to CD. After that he wrote down the names of the games one after another in a circle on the CD in clockwise order. The names were distinct, the length of each name was equal to k. The names didn't overlap.

Thus, there is a cyclic string of length n·k written on the CD.

Several years have passed and now Tolya can't remember which games he burned to his CD. He knows that there were g popular games that days. All of the games he burned were among these g games, and no game was burned more than once.

You have to restore any valid list of games Tolya could burn to the CD several years ago.

Input

The first line of the input contains two positive integers n and k (1 ≤ n ≤ 105, 1 ≤ k ≤ 105) — the amount of games Tolya burned to the CD, and the length of each of the names.

The second line of the input contains one string consisting of lowercase English letters — the string Tolya wrote on the CD, split in arbitrary place. The length of the string is n·k. It is guaranteed that the length is not greater than 106.

The third line of the input contains one positive integer g (n ≤ g ≤ 105) — the amount of popular games that could be written on the CD. It is guaranteed that the total length of names of all popular games is not greater than 2·106.

Each of the next g lines contains a single string — the name of some popular game. Each name consists of lowercase English letters and has length k. It is guaranteed that the names are distinct.

Output

If there is no answer, print "NO" (without quotes).

Otherwise, print two lines. In the first line print "YES" (without quotes). In the second line, print n integers — the games which names were written on the CD. You should print games in the order they could have been written on the CD, it means, in clockwise order. You can print games starting from any position. Remember, that no game was burned to the CD more than once. If there are several possible answers, print any of them.

Examples

Input

3 1
abc
4
b
a
c
d


Output

YES
2 1 3 


Input

4 2
aabbccdd
4
dd
ab
bc
cd


Output

NO

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <typename T>
ostream &operator<<(ostream &o, vector<T> &v) {
  for (auto &x : v) o << x << ' ';
  return o;
}
struct suffix {
  int rank[2], idx;
};
class SuffixArray {
 private:
  int n;
  string str;
  vector<int> sarray, indx;
  vector<int> lcp;
  void radixSort(vector<suffix> &S, vector<suffix> &tmp, int rk) {
    int d = max(256, n);
    vector<int> c(d + 1, 0);
    for (int i = 0; i < n; i++) {
      c[S[i].rank[rk]]++;
    }
    for (int i = 0, sum = 0; i <= d; i++) {
      int t = c[i];
      c[i] = sum;
      sum += t;
    }
    for (int i = 0; i < n; i++) tmp[c[S[i].rank[rk]]++] = S[i];
    S = tmp;
  }

 public:
  SuffixArray(string &_str) : str(_str) {}
  vector<int> build_sarray() {
    n = (int)str.size();
    sarray.resize(n);
    indx.resize(n);
    vector<suffix> S(n), tmp(n);
    for (int i = 0; i < n; i++) {
      S[i].idx = i;
      S[i].rank[0] = (int)str[i] - CHAR_MIN + 1;
      S[i].rank[1] = 0;
    }
    radixSort(S, tmp, 0);
    for (int k = 1; k < n; k <<= 1) {
      vector<int> A(n);
      for (int i = 0; i < n; i++) A[S[i].idx] = S[i].rank[0];
      for (int i = 0; i < n; i++) {
        int id = S[i].idx;
        S[i].rank[1] = (id + k < n) ? A[id + k] : 0;
      }
      radixSort(S, tmp, 1);
      radixSort(S, tmp, 0);
      S[0].rank[0] = 1;
      for (int i = 1; i < n; i++) {
        S[i].rank[0] = S[i - 1].rank[0];
        if (tmp[i].rank[0] != tmp[i - 1].rank[0] ||
            tmp[i].rank[1] != tmp[i - 1].rank[1])
          S[i].rank[0]++;
      }
      if (S[n - 1].rank[0] == n) break;
    }
    for (int i = 0; i < n; i++) {
      sarray[i] = S[i].idx;
      indx[S[i].idx] = i;
    }
    return sarray;
  }
  vector<int> build_lcp() {
    lcp.resize(n);
    int len = 0;
    for (int i = 0; i < n; i++) {
      int id = indx[i];
      if (id) {
        int j = sarray[id - 1];
        while (i + len < n && j + len < n && str[i + len] == str[j + len])
          len++;
        lcp[id] = len;
      }
      len = max(len - 1, 0);
    }
    lcp[0] = 0;
    return lcp;
  }
  vector<int> get_indx() { return indx; }
  struct Comp {
    const string &s;
    int m;
    Comp(const string &str, int M) : s(str), m(M) {}
    bool operator()(int i, const string &p) const {
      return s.compare(i, m, p, 0, m) < 0;
    }
    bool operator()(const string &p, int i) const {
      return s.compare(i, m, p, 0, m) > 0;
    }
  };
  pair<int, int> find(string &patt) {
    auto p =
        equal_range(sarray.begin(), sarray.end(), patt, Comp(str, patt.size()));
    return {p.first - sarray.begin(), p.second - sarray.begin()};
  }
};
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  string str;
  cin >> str;
  str += str.substr(0, k - 1);
  SuffixArray sa(str);
  vector<int> sarray = sa.build_sarray();
  int g;
  cin >> g;
  vector<vector<int> > matched(n, vector<int>(k, -1));
  for (int i = 0; i < g; i++) {
    string patt;
    cin >> patt;
    pair<int, int> p = sa.find(patt);
    for (int j = p.first; j < p.second; j++) {
      int id = sarray[j];
      matched[id / k][id % k] = i;
    }
  }
  for (int i = 0; i < k; i++) {
    vector<int> ans;
    vector<int> used(g, 0);
    for (int j = 0; j < n; j++) {
      if (matched[j][i] == -1) break;
      if (used[matched[j][i]]) break;
      used[matched[j][i]] = 1;
      ans.push_back(matched[j][i]);
    }
    if ((int)ans.size() == n) {
      cout << "YES" << endl;
      for (int x : ans) cout << x + 1 << ' ';
      cout << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}