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 <int mod>
class INT {
 public:
  template <class P1, class P2>
  static P1 ppow(P1 a, P2 b) {
    P1 res = 1LL;
    while (b) {
      if ((b & 1LL)) {
        res *= a;
      }
      a *= a;
      b >>= 1;
    }
    return res;
  }
  long long int NUM;
  INT(long long int NUM_ = 0) : NUM(NUM_){};
  INT inverse() {
    if (mod == 1000000007 || mod == 1000000009) {
      return ppow((*this), mod - 2);
    } else {
      long long int a = NUM, b = mod, u = 1, v = 0, t;
      while (b) {
        t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
      }
      if (u < 0) u += mod;
      INT res;
      res.NUM = u;
      return res;
    }
  }
  INT &operator+=(const INT &a) {
    if ((NUM += a.NUM) >= mod) NUM -= mod;
    return *this;
  }
  INT &operator-=(const INT &a) {
    if ((NUM += mod - a.NUM) >= mod) NUM -= mod;
    return *this;
  }
  INT &operator*=(const INT &a) {
    (NUM *= a.NUM);
    if (NUM >= mod) (NUM %= mod);
    return *this;
  }
  INT &operator/=(const INT &a) {
    NUM *= inverse().NUM;
    NUM %= mod;
    return *this;
  }
  INT operator+(const INT &a) const { return INT(*this) += a; }
  INT operator-(const INT &a) const { return INT(*this) -= a; }
  INT operator*(const INT &a) const { return INT(*this) *= a; }
  INT operator/(const INT &a) const { return INT(*this) /= a; }
  bool operator<(const INT &a) const { return NUM < a.NUM; }
  bool operator>(const INT &a) const { return NUM > a.NUM; }
  bool operator==(const INT &a) const { return NUM == a.NUM; }
  bool operator!=(const INT &a) const { return NUM != a.NUM; }
};
template <class P1, class P2>
class vec {
 public:
  P1 first;
  P2 second;
  vec() {}
  vec(P1 a_, P2 b_) : first(a_), second(b_){};
  void make(P1 a_, P2 b_) {
    first = a_;
    second = b_;
  }
  void output() { cout << first << " " << second << endl; }
  template <class P3, class P4>
  vec &operator+=(const vec<P3, P4> &a) {
    (*this).first += a.first;
    (*this).second += a.second;
    return *this;
  }
  template <class P3, class P4>
  vec &operator-=(const vec<P3, P4> &a) {
    (*this).first -= a.first;
    (*this).second -= a.second;
    return *this;
  }
  template <class P3, class P4>
  vec &operator*=(const vec<P3, P4> &a) {
    (*this).first *= a.first;
    (*this).second *= a.second;
    return *this;
  }
  template <class P3, class P4>
  vec &operator/=(const vec<P3, P4> &a) {
    (*this).first /= a.first;
    (*this).second /= a.second;
    return *this;
  }
  template <class P3, class P4>
  vec &operator^=(const vec<P3, P4> &a) {
    (*this).first ^= a.first;
    (*this).second ^= a.second;
    return *this;
  }
  template <class P3, class P4>
  vec &operator&=(const vec<P3, P4> &a) {
    (*this).first &= a.first;
    (*this).second &= a.second;
    return *this;
  }
  template <class P3, class P4>
  vec &operator|=(const vec<P3, P4> &a) {
    (*this).first |= a.first;
    (*this).second |= a.second;
    return *this;
  }
  template <class P3, class P4>
  bool operator<(const vec<P3, P4> &a) const {
    return make_pair(first, second) < make_pair(a.first, a.second);
  }
  template <class P3, class P4>
  bool operator>(const vec<P3, P4> &a) const {
    return make_pair(first, second) > make_pair(a.first, a.second);
  }
};
namespace vec_operator {
template <typename P1, typename P2, typename P3, typename P4>
bool operator==(vec<P1, P2> A, vec<P3, P4> B) {
  return (A.first == B.first) && (A.second == B.second);
}
template <typename P1, typename P2, typename P3, typename P4>
bool operator!=(vec<P1, P2> A, vec<P3, P4> B) {
  return !((A.first == B.first) && (A.second == B.second));
}
template <typename P1, typename P2, typename P3, typename P4>
vec<P1, P2> operator*(vec<P1, P2> A, vec<P3, P4> B) {
  vec<P1, P2> r;
  r.first = A.first * B.first;
  r.second = A.second * B.second;
  return r;
}
template <typename P1, typename P2, typename P3, typename P4>
vec<P1, P2> operator+(vec<P1, P2> A, vec<P3, P4> B) {
  vec<P1, P2> r;
  r.first = A.first + B.first;
  r.second = A.second + B.second;
  return r;
}
template <typename P1, typename P2, typename P3, typename P4>
vec<P1, P2> operator-(vec<P1, P2> A, vec<P3, P4> B) {
  vec<P1, P2> r;
  r.first = A.first - B.first;
  r.second = A.second - B.second;
  return r;
}
template <typename P1, typename P2, typename P3, typename P4>
vec<P1, P2> operator/(vec<P1, P2> A, vec<P3, P4> B) {
  vec<P1, P2> r;
  r.first = A.first / B.first;
  r.second = A.second / B.second;
  return r;
}
template <typename P1, typename P2, typename P3, typename P4>
vec<P1, P2> operator&(vec<P1, P2> A, vec<P3, P4> B) {
  vec<P1, P2> r;
  r.first = A.first & B.first;
  r.second = A.second & B.second;
  return r;
}
template <typename P1, typename P2, typename P3, typename P4>
vec<P1, P2> operator^(vec<P1, P2> A, vec<P3, P4> B) {
  vec<P1, P2> r;
  r.first = A.first ^ B.first;
  r.second = A.second ^ B.second;
  return r;
}
template <typename P1, typename P2, typename P3, typename P4>
vec<P1, P2> operator|(vec<P1, P2> A, vec<P3, P4> B) {
  vec<P1, P2> r;
  r.first = A.first | B.first;
  r.second = A.second | B.second;
  return r;
}
template <typename P1, typename P2, class P3>
vec<P1, P2> operator+(vec<P1, P2> A, P3 B) {
  A.first = A.first + B;
  A.second = A.second + B;
  return A;
}
template <class P1, class P2, class P3>
vec<P1, P2> operator*(vec<P1, P2> A, P3 B) {
  A.first = A.first * B;
  A.second = A.second * B;
  return A;
}
template <class P1, class P2, class P3>
vec<P1, P2> operator-(vec<P1, P2> A, P3 B) {
  A.first = A.first - B;
  A.second = A.second - B;
  return A;
}
template <class P1, class P2, class P3>
vec<P1, P2> operator/(vec<P1, P2> A, P3 B) {
  A.first = A.first / B;
  A.second = A.second / B;
  return A;
}
template <class P1, class P2, class P3>
vec<P1, P2> operator&(vec<P1, P2> A, P3 B) {
  A.first = A.first & B;
  A.second = A.second & B;
  return A;
}
template <class P1, class P2, class P3>
vec<P1, P2> operator^(vec<P1, P2> A, P3 B) {
  A.first = A.first ^ B;
  A.second = A.second ^ B;
  return A;
}
template <class P1, class P2, class P3>
vec<P1, P2> operator|(vec<P1, P2> A, P3 B) {
  A.first = A.first | B;
  A.second = A.second | B;
  return A;
}
template <typename P1, typename P2, class P3>
vec<P2, P3> operator+(P1 A, vec<P2, P3> B) {
  B = B + A;
  return B;
}
template <typename P1, typename P2, class P3>
vec<P2, P3> operator*(P1 A, vec<P2, P3> B) {
  B = B * A;
  return B;
}
template <typename P1, typename P2, class P3>
vec<P2, P3> operator-(P1 A, vec<P2, P3> B) {
  B = B - A;
  return B;
}
template <typename P1, typename P2, class P3>
vec<P2, P3> operator/(P1 A, vec<P2, P3> B) {
  B = B / A;
  return B;
}
template <typename P1, typename P2, class P3>
vec<P2, P3> operator&(P1 A, vec<P2, P3> B) {
  B = B & A;
  return B;
}
template <typename P1, typename P2, class P3>
vec<P2, P3> operator^(P1 A, vec<P2, P3> B) {
  B = B ^ A;
  return B;
}
template <typename P1, typename P2, class P3>
vec<P2, P3> operator|(P1 A, vec<P2, P3> B) {
  B = B | A;
  return B;
}
}  // namespace vec_operator
using namespace vec_operator;
class HASH_KEY {
 public:
  vec<INT<1000000007>, INT<1000000009>> key_;
  int size_;
  HASH_KEY() : key_(vec<INT<1000000007>, INT<1000000009>>(0, 0)), size_(0){};
  template <class A, class B>
  HASH_KEY(A KEY_, B SIZE_) : key_(KEY_), size_(SIZE_){};
  int size() { return size_; }
  vec<INT<1000000007>, INT<1000000009>> key() { return key_; }
  void shift_right(int NUM);
  void shift_left(int NUM);
  bool operator==(const HASH_KEY &a) const {
    return (key_ == a.key_) && (size_ == a.size_);
  }
};
class HASH {
 public:
  static vector<vec<INT<1000000007>, INT<1000000009>>> base;
  static vector<vec<INT<1000000007>, INT<1000000009>>> rbase;
  static void init(int size_);
  template <class ty1>
  static vec<INT<1000000007>, INT<1000000009>> key(ty1 T);
  vec<INT<1000000007>, INT<1000000009>> MOD_PAIR;
  HASH() {
    MOD_PAIR = vec<INT<1000000007>, INT<1000000009>>(1000000007, 1000000009);
  }
  vector<vec<INT<1000000007>, INT<1000000009>>> v;
  template <class HASHED>
  void set(HASHED &ss) {
    v.clear();
    v.resize(ss.size());
    int siz = ss.size();
    vec<INT<1000000007>, INT<1000000009>> sum(0, 0);
    for (int i = 0; i < siz; i++) {
      sum = sum + base[i] * key(ss[i]);
      v[i] = sum;
    }
  }
  HASH_KEY substr(int l, int r) {
    vec<INT<1000000007>, INT<1000000009>> R(0, 0);
    if (r == 0) return HASH_KEY(vec<INT<1000000007>, INT<1000000009>>(0, 0), 0);
    r = l + r - 1;
    R = v[r];
    if (l) R = R - v[l - 1];
    R = R * rbase[l];
    return HASH_KEY(R, r - l + 1);
  }
  int size() { return v.size(); }
  HASH_KEY all() {
    if (v.size() == 0) {
      return HASH_KEY(vec<INT<1000000007>, INT<1000000009>>(0, 0), 0);
    }
    return HASH_KEY(v.back(), v.size());
  }
  template <class HASHED>
  void append(HASHED A) {
    if (v.size())
      v.push_back(base[v.size()] * key(A) + v.back());
    else
      v.push_back(base[v.size()] * key(A));
  }
  void pop_back() {
    if (v.size()) {
      v.pop_back();
    }
  }
};
vector<vec<INT<1000000007>, INT<1000000009>>> HASH::base;
vector<vec<INT<1000000007>, INT<1000000009>>> HASH::rbase;
void HASH::init(int size_) {
  base.size();
  base.assign(size_, vec<INT<1000000007>, INT<1000000009>>());
  HASH::rbase = HASH::base;
  HASH::base[0] = vec<INT<1000000007>, INT<1000000009>>(1, 1);
  vec<INT<1000000007>, INT<1000000009>> cur(6256262, 67856784);
  for (int i = 1; i < size_; i++) {
    HASH::base[i] = HASH::base[i - 1] * cur;
  }
  cerr << "r" << endl;
  for (int i = 0; i < size_; i++) {
    HASH::rbase[i] = HASH::base[i];
    rbase[i].first = rbase[i].first.inverse();
    rbase[i].second = rbase[i].second.inverse();
  }
}
template <class ty1>
vec<INT<1000000007>, INT<1000000009>> HASH::key(ty1 T) {
  return vec<INT<1000000007>, INT<1000000009>>((long long int)(T),
                                               (long long int)(T));
}
HASH_KEY operator+(HASH_KEY b, HASH_KEY a) {
  return HASH_KEY(b.key_ + HASH::base[b.size_] * a.key_, b.size_ + a.size_);
}
HASH_KEY operator+(HASH_KEY &b, HASH &a) { return b + a.all(); }
void HASH_KEY::shift_right(int NUM) { key_ *= HASH::base[NUM]; }
void HASH_KEY::shift_left(int NUM) { key_ *= HASH::rbase[NUM]; }
int n;
int k;
int g;
char buf[2000002];
string s;
HASH S;
vector<HASH> v;
vector<vec<INT<1000000007>, INT<1000000009>>> uf[100002];
string buf2;
map<vec<INT<1000000007>, INT<1000000009>>, int> mp;
int main() {
  cin >> n >> k;
  scanf("%s", buf);
  s = buf;
  HASH::init(2000002);
  int m;
  cin >> m;
  for (int i = 0; i < m; i++) {
    scanf("%s", buf);
    v.push_back(HASH());
    buf2 = buf;
    v.back().set(buf2);
    mp[v.back().all().key()] = i;
  }
  s += s;
  S.set(s);
  for (int i = 0; i < n * k; i++) {
    auto f = S.substr(i, k);
    uf[i % k].push_back(f.key());
  }
  for (int i = 0; i < k; i++) {
    bool ok = true;
    vector<int> ans;
    set<int> sss;
    for (auto it = uf[i].begin(); it != uf[i].end(); it++) {
      if (mp.count((*it)) == 0) {
        ok = false;
        break;
      }
      sss.insert(mp[(*it)]);
      ans.push_back(mp[(*it)]);
    }
    if (sss.size() == n && ok) {
      puts("YES");
      for (int j = 0; j < ans.size(); j++) {
        if (j) printf(" ");
        printf("%d", ans[j] + 1);
      }
      puts("");
      return 0;
    }
  }
  puts("NO");
  return 0;
}