#include <bits/stdc++.h>
using namespace std;
template <class T1, class T2>
inline istream& operator>>(istream& fin, pair<T1, T2>& pr) {
  fin >> pr.first >> pr.second;
  return fin;
}
template <class T0, class T1, class T2>
inline istream& operator>>(istream& fin, tuple<T0, T1, T2>& t) {
  fin >> get<0>(t) >> get<1>(t) >> get<2>(t);
  return fin;
}
template <class T>
inline istream& operator>>(istream& fin, vector<T>& a) {
  for (auto& u : a) fin >> u;
  return fin;
}
template <class T, size_t n>
inline istream& operator>>(istream& fin, array<T, n>& a) {
  for (auto& u : a) fin >> u;
  return fin;
}
inline int64_t powmod(int64_t a, int64_t n, const int64_t mod) {
  if (a == 1 || !n) return mod != 1 ? 1 : 0;
  int64_t out = 1;
  for (; n; n >>= 1) {
    if (n & 1) out = out * a % mod;
    a = a * a % mod;
  }
  return out;
}
void f533() {
  const int64_t mul = 29;
  const int64_t mod = 1000000007;
  array<size_t, 2> len;
  vector<string> str(2);
  cin >> len >> str;
  vector<int64_t> a(26), b(26);
  for (size_t i = 0; i < len[1]; ++i) {
    const auto inc = powmod(mul, len[1] - i - 1, mod);
    size_t j = str[0][i] - 'a';
    a[j] += inc;
    a[j] %= mod;
    j = str[1][i] - 'a';
    b[j] += inc;
    b[j] %= mod;
  }
  vector<bool> tag(26, false);
  const auto fail = [&a, &b, &tag]() -> bool {
    fill(begin(tag), end(tag), false);
    bool fail = false;
    for (size_t i = 0; i < 26 && !fail; fail = !tag[i++])
      if (!tag[i])
        for (size_t j = i; j < 26 && !tag[i]; ++j)
          if (!tag[j] && a[i] == b[j] && a[j] == b[i]) tag[i] = tag[j] = true;
    return fail;
  };
  vector<size_t> out;
  if (!fail()) out.push_back(1);
  const auto inc = powmod(mul, len[1] - 1, mod);
  for (size_t i = len[1]; i < len[0]; ++i) {
    {
      const auto j = str[0][i - len[1]] - 'a';
      a[j] -= inc;
      a[j] = (a[j] % mod + mod) % mod;
    }
    for (size_t j = 0; j < 26; ++j) a[j] *= mul, a[j] %= mod;
    {
      const auto j = str[0][i] - 'a';
      a[j] += 1;
      a[j] %= mod;
    }
    if (!fail()) out.push_back(i - len[1] + 2);
  }
  cout << out.size() << '\n';
  copy(begin(out), end(out), ostream_iterator<size_t>(cout, " "));
}
int main(const int argc, char* argv[]) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  f533();
  return EXIT_SUCCESS;
}
