#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int base = 131;
const int mod = 19260817;
int sl, tl, ans, Stack[N], nxt[N][26];
long long T_hash, s_hash[N][26], fac[N];
int vis[27];
char s[N], t[N];
int main() {
  scanf("%d %d %s %s", &sl, &tl, s + 1, t + 1);
  fac[0] = 1;
  for (int i = 1; i <= sl; i++) fac[i] = fac[i - 1] * base % mod;
  for (int j = 0; j < 26; j++) nxt[sl + 1][j] = sl + 1;
  for (int i = sl; i >= 1; i--)
    for (int j = 0; j < 26; j++) {
      if (s[i] == j + 'a')
        nxt[i][j] = i;
      else
        nxt[i][j] = nxt[i + 1][j];
    }
  for (int i = 1; i <= tl; i++) T_hash = (T_hash * base + (t[i] - 'a')) % mod;
  for (int i = 1; i <= sl; i++)
    for (int j = 0; j < 26; j++) {
      if (s[i] == j + 'a')
        s_hash[i][j] = (s_hash[i - 1][j] * base + 1) % mod;
      else
        s_hash[i][j] = s_hash[i - 1][j] * base % mod;
    }
  for (int i = 1; i <= sl - tl + 1; i++) {
    long long tot_hash = 0;
    memset(vis, -1, sizeof vis);
    for (int j = 0; j < 26; j++) {
      int p = nxt[i][j];
      if (p > i + tl - 1) continue;
      int y = t[p - i + 1] - 'a';
      if (vis[j] == -1 && vis[y] == -1) vis[y] = j, vis[j] = y;
      tot_hash =
          (tot_hash +
           vis[j] *
               ((s_hash[i + tl - 1][j] - s_hash[i - 1][j] * fac[tl]) % mod +
                mod)) %
          mod;
    }
    if (tot_hash == T_hash) Stack[++ans] = i;
  }
  printf("%d\n", ans);
  for (int i = 1; i <= ans; i++) printf("%d ", Stack[i]);
  return 0;
}
