#include <bits/stdc++.h>
using namespace std;
const int maxN = 2e5 + 5;
const long long base = 9999991;
int n, m;
char s1[maxN], s2[maxN];
vector<int> res;
long long p[maxN], h1[30], h2[30];
int mark[30];
int check() {
  for (int i = 0; i <= 25; ++i)
    if (h1[i]) {
      mark[i] = -1;
      for (int j = 0; j <= 25; ++j)
        if (h1[i] == h2[j]) mark[i] = j;
      if (mark[i] == -1) return 0;
    } else
      mark[i] = -2;
  for (int i = 0; i <= 25; ++i)
    if (h1[i] && mark[mark[i]] != i && mark[mark[i]] != -2) return 0;
  return 1;
}
int main() {
  scanf("%d %d\n%s\n%s", &n, &m, s1 + 1, s2 + 1);
  p[0] = 1;
  for (int i = 1; i <= n; ++i) p[i] = p[i - 1] * 2 % base;
  for (int i = 1; i <= m; ++i)
    for (int j = 0; j <= 25; ++j) {
      if (s1[i] - 'a' == j)
        h1[j] = (h1[j] * 2 + 1) % base;
      else
        h1[j] = h1[j] * 2 % base;
      if (s2[i] - 'a' == j)
        h2[j] = (h2[j] * 2 + 1) % base;
      else
        h2[j] = h2[j] * 2 % base;
    }
  if (check()) res.push_back(1);
  for (int i = m + 1; i <= n; ++i) {
    for (int j = 0; j <= 25; ++j) {
      if (s1[i - m] - 'a' == j) h1[j] = (h1[j] - p[m - 1] + base) % base;
      ;
      if (s1[i] - 'a' == j)
        h1[j] = (h1[j] * 2 + 1) % base;
      else
        h1[j] = h1[j] * 2 % base;
    }
    if (check()) res.push_back(i - m + 1);
  }
  printf("%d\n", (int)res.size());
  for (int i = 0; i < (int)res.size(); ++i) printf("%d ", res[i]);
  return 0;
}
