#include <bits/stdc++.h>
using namespace std;
inline int in() {
  char c = getchar();
  int neg = 1, x = 0;
  while (!isdigit(c)) (c == '-') ? neg = -1, c = getchar() : c = getchar();
  while (isdigit(c)) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  return neg * x;
}
const int MAX = 2e5 + 5;
const long long p = 43;
const long long mod = 1e9 + 7;
vector<int> ret;
int N, M;
char str1[MAX], str2[MAX];
long long H1[26][MAX], H2[26][MAX], base[MAX];
inline void pre_work() {
  base[0] = 1;
  for (register int i = 1; i <= MAX - 2; i++) base[i] = base[i - 1] * p % mod;
  for (register int i = 0; i < 26; i++)
    for (register int j = 1; j <= N; j++)
      H1[i][j] = (H1[i][j - 1] * p + (str1[j] == (char)(i + 'a')) + 1) % mod;
  for (register int i = 0; i < 26; i++)
    for (register int j = 1; j <= N; j++)
      H2[i][j] = (H2[i][j - 1] * p + (str2[j] == (char)(i + 'a')) + 1) % mod;
}
inline long long GetHash(long long *H, int l, int r) {
  return (H[r] - H[l] * base[r - l] % mod + mod) % mod;
}
inline bool check(int pos) {
  for (register int i = 0; i < 26; i++) {
    bool vie = false;
    for (register int j = 0; j < 26; j++)
      vie |= (GetHash(H1[i], pos - 1, pos + M - 1) == H2[j][M]) &&
             (GetHash(H1[j], pos - 1, pos + M - 1) == H2[i][M]);
    if (!vie) return false;
  }
  return true;
}
int main() {
  N = in(), M = in();
  scanf("%s%s", str1 + 1, str2 + 1);
  pre_work();
  check(7);
  for (register int i = 1; i <= N - M + 1; i++)
    if (check(i)) ret.push_back(i);
  printf("%d\n", ret.size());
  for (__typeof((ret).begin()) it = (ret).begin(); it != (ret).end(); it++)
    printf("%d ", *it);
  puts("");
  return 0;
}
