#include <bits/stdc++.h>
using namespace std;
const int maxn = 200500;
int n, m;
char s[200500], t[200500], ss[200500], tt[200500];
int nxt[200500], mat[200500][30];
vector<int> ans;
int main() {
  scanf("%d%d", &n, &m);
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  for (char x = 'a'; x <= 'z'; x++)
    for (char y = x; y <= 'z'; y++) {
      for (int i = 1; i <= n; i++)
        ss[i] = (s[i] == x || s[i] == y) ? s[i] : '$';
      for (int i = 1; i <= m; i++) tt[i] = t[i] == x ? y : t[i] == y ? x : '$';
      for (int i = 2, j = 0; i <= m; i++) {
        while (j && tt[j + 1] != tt[i]) j = nxt[j];
        if (tt[j + 1] == tt[i]) j++;
        nxt[i] = j;
      }
      for (int i = 1, j = 0; i <= n; i++) {
        while (j && tt[j + 1] != ss[i]) j = nxt[j];
        if (tt[j + 1] == ss[i]) j++;
        if (j == m) {
          mat[i - m + 1][x - 'a'] = y;
          mat[i - m + 1][y - 'a'] = x;
          j = nxt[j];
        }
      }
    }
  for (int i = 1; i <= n; i++) {
    int gg = 0;
    for (int j = 0; j <= 25; j++)
      if (!mat[i][j]) gg = 1;
    if (!gg) ans.push_back(i);
  }
  printf("%d\n", (int)ans.size());
  for (auto x : ans) printf("%d ", x);
  return 0;
}
