#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
int n, m, ans, res[N];
long long bas = 131;
unsigned long long p, ha1[N][30], ha2[N][30];
char s1[N], s2[N];
int main() {
  scanf("%d%d", &n, &m);
  scanf("%s%s", s1 + 1, s2 + 1);
  p = 1;
  for (int i = 1; i <= m; i++) p *= bas;
  for (int i = 0; i < 26; i++)
    for (int j = 1; j <= n; j++)
      ha1[j][i] = ha1[j - 1][i] * bas + (s1[j] - 'a' == i);
  for (int i = 0; i < 26; i++)
    for (int j = 1; j <= m; j++)
      ha2[j][i] = ha2[j - 1][i] * bas + (s2[j] - 'a' == i);
  for (int i = 1; i <= n - m + 1; i++) {
    bool ok = 1;
    for (int j = 0; j < 26; j++) {
      bool flag = 0;
      for (int k = 0; k < 26; k++)
        if (ha2[m][j] == ha1[i + m - 1][k] - ha1[i - 1][k] * p &&
            ha2[m][k] == ha1[i + m - 1][j] - ha1[i - 1][j] * p) {
          flag = 1;
          break;
        }
      if (!flag) {
        ok = 0;
        break;
      }
    }
    if (ok) res[++ans] = i;
  }
  printf("%d\n", ans);
  for (int i = 1; i <= ans; i++) printf("%d ", res[i]);
  return 0;
}
