#include <bits/stdc++.h>
using namespace std;
int qp(int a, long long b) {
  int ans = 1;
  do {
    if (b & 1) ans = 1ll * ans * a % 1000000007;
    a = 1ll * a * a % 1000000007;
  } while (b >>= 1);
  return ans;
}
int ans[222222], atot = 0;
char s[222222], t[222222];
long long ct[26];
int n, m;
long long cs[26];
int sd = 10007;
map<pair<long long, long long>, int> ma;
long long ps[222222];
int test() {
  ma.clear();
  for (int i = 0; i < 26; i++) {
    if (cs[i] == ct[i]) continue;
    if (ma[make_pair(ct[i], cs[i])])
      ma[make_pair(ct[i], cs[i])]--;
    else
      ma[make_pair(cs[i], ct[i])]++;
  }
  for (map<pair<long long, long long>, int>::iterator it = ma.begin();
       it != ma.end(); it++) {
    if (it->second) return 0;
  }
  return 1;
}
int main() {
  ps[0] = 1;
  for (int i = 1; i <= 211111; i++) ps[i] = ps[i - 1] * sd;
  scanf("%d%d", &n, &m);
  scanf("%s", s + 1);
  scanf("%s", t + 1);
  for (int i = 1; i <= m; i++) ct[t[i] - 'a'] += ps[m - i + 1];
  for (int i = 1; i <= m; i++) cs[s[i] - 'a'] += ps[m - i + 1];
  for (int i = 1; i + m - 1 <= n; i++) {
    if (test()) ans[++atot] = i;
    cs[s[i] - 'a'] -= ps[m];
    for (int j = 0; j < 26; j++) cs[j] *= sd;
    cs[s[i + m] - 'a'] += ps[1];
  }
  printf("%d\n", atot);
  for (int i = 1; i <= atot; i++) printf("%d ", ans[i]);
  printf("\n");
  return 0;
}
