#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
inline long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
inline string get() {
  char ch[2000010];
  scanf("%s", ch);
  return ch;
}
const int MAX_LG = 21;
const long long maxn = 1e6 + 10;
const long long maxm = 1e5 + 10;
const long long base = 29;
const long long mod = 1e9 + 7;
const long long base2 = 31;
const long long mod2 = 1e9 + 9;
const long long INF = 2e18 + 100;
const long long SQ = 317;
vector<long long> vc[30];
long long ptr[30];
long long kmp[maxn];
inline bool ok(string &s, string &t, long long tmp, long long p) {
  for (long long i = 0; i < 26; i++) {
    while (ptr[i] < vc[i].size() && vc[i][ptr[i]] < p - tmp) ptr[i]++;
    if (ptr[i] < vc[i].size() && vc[i][ptr[i]] < p) {
      long long cnt = bool(s[p] == s[vc[i][ptr[i]]]) +
                      bool(t[tmp] == t[vc[i][ptr[i]] - (p - tmp)]);
      if (cnt == 1) return false;
    }
  }
  return true;
}
vector<long long> res;
long long match[30];
int32_t main() {
  long long n = in(), m = in();
  string s = get(), t = get();
  for (long long i = 0; i < m; i++) vc[t[i] - 'a'].push_back(i);
  long long tmp = 0;
  for (long long i = 1; i < m; i++) {
    while (tmp && !ok(t, t, tmp, i)) tmp = kmp[tmp - 1];
    if (ok(t, t, tmp, i)) tmp++;
    kmp[i] = tmp;
  }
  for (long long i = 0; i < 26; i++) vc[i].clear(), ptr[i] = 0;
  for (long long i = 0; i < n; i++) vc[s[i] - 'a'].push_back(i);
  tmp = 0;
  for (long long i = 0; i < n; i++) {
    while (tmp && (tmp == m || !ok(s, t, tmp, i))) tmp = kmp[tmp - 1];
    if (ok(s, t, tmp, i)) tmp++;
    if (tmp == m) {
      for (long long j = 0; j < 26; j++) match[j] = -1;
      for (long long j = 0; j < 26; j++) {
        if (ptr[j] < vc[j].size() && vc[j][ptr[j]] <= i)
          match[j] = t[vc[j][ptr[j]] - (i - (m - 1))] - 'a';
      }
      bool fl = true;
      for (long long j = 0; j < 26; j++) {
        if (match[j] != -1 && match[match[j]] != j) {
          if (match[match[j]] == -1)
            match[match[j]] = j;
          else
            fl = false;
        }
      }
      if (fl) res.push_back(i - m + 2);
    }
  }
  cout << res.size() << "\n";
  for (auto v : res) cout << v << " ";
  cout << "\n";
}
