#include <bits/stdc++.h>
using namespace std;
char s[200001], t[200001];
int N, M;
long long hS[200000][26];
long long hT[200000][26];
long long pw[200001];
int lst[26];
int occ[26];
void shift(int i, long long hd[200000][26], char *text) {
  int c = text[i] - 'a';
  if (!occ[c] && i >= M) lst[c] = i - (M + 1);
  hd[i][c] = (hd[i][c] * 200001 + (i - lst[c])) % 1000000007;
  occ[c]++;
  lst[c] = i;
  if (i >= M) {
    for (int c = 0; c < 26; c++) {
      if (occ[c])
        hd[i][c] = (hd[i][c] - pw[occ[c] - 1] * 1 + 1000000007) % 1000000007;
      if (c == (text[i - M] - 'a')) occ[c]--;
    }
  }
}
long long match[26];
int used[26];
int pr[26];
int main() {
  scanf("%d %d", &N, &M);
  scanf("%s", s);
  scanf("%s", t);
  pw[0] = 1;
  for (int i = 1; i <= 200000; i++) pw[i] = (pw[i - 1] * 200001) % 1000000007;
  for (int c = 0; c < 26; c++) lst[c] = -1;
  for (int i = 0; i < M; i++) {
    if (i > 0)
      for (int c = 0; c < 26; c++) hT[i][c] = hT[i - 1][c];
    shift(i, hT, t);
  }
  for (int c = 0; c < 26; c++) lst[c] = -1, occ[c] = 0;
  for (int i = 0; i < N; i++) {
    if (i > 0)
      for (int c = 0; c < 26; c++) hS[i][c] = hS[i - 1][c];
    shift(i, hS, s);
  }
  for (int c = 0; c < 26; c++) match[c] = hT[M - 1][c];
  vector<int> occs[26];
  vector<int> ans;
  for (int i = 0; i < (M - 1); i++) occs[s[i] - 'a'].push_back(i);
  int c, d;
  bool good;
  for (int i = M - 1; i < N; i++) {
    occs[s[i] - 'a'].push_back(i);
    for (c = 0; c < 26; c++) used[c] = 0, pr[c] = -1;
    good = 1;
    for (c = 0; c < 26; c++) {
      if (occs[c].size() == 0) continue;
      if (occs[c][occs[c].size() - 1] < (i - (M - 1))) continue;
      d = t[occs[c][occs[c].size() - 1] - (i - (M - 1))] - 'a';
      if (used[c] && pr[c] != d) break;
      if (used[d] && pr[d] != c) break;
      if (match[d] != hS[i][c]) break;
      used[d] = 1, pr[c] = d;
      used[c] = 1, pr[d] = c;
    }
    if (c == 26) ans.push_back(i - (M - 1));
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < ans.size(); i++) printf("%d ", ans[i] + 1);
  printf("\n");
  return 0;
}
