#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 5;
const long long linf = 1e18 + 5;
const int N = 2e5 + 5;
const int P = 237509;
const int mod = 1e9 + 7;
int n, m, eq[26], len_to[26][N], hash2[26][N], hash3[26][N];
long long power[N], cur[26], something_stupid[26];
char a[N], b[N];
vector<int> ans;
long long get(int w, int x, int y) {
  return ((hash2[w][y] - (long long)hash2[w][x - 1] *
                             power[len_to[w][y] - len_to[w][x - 1]]) %
              mod +
          mod) %
         mod;
}
long long get2(int w, int x, int y) {
  return ((hash3[w][y] - (long long)hash3[w][x - 1] *
                             power[len_to[w][y] - len_to[w][x - 1]]) %
              mod +
          mod) %
         mod;
}
int main() {
  cin >> n >> m;
  scanf("%s %s", a + 1, b + 1);
  power[0] = 1;
  for (int i = 1; i <= n; i++) {
    power[i] = power[i - 1] * P % mod;
    for (int j = 0; j <= 26 - 1; j++) {
      if (a[i] - 'a' == j) {
        hash2[j][i] = ((long long)hash2[j][i - 1] * P + 1) % mod;
        hash3[j][i] = ((long long)hash3[j][i - 1] * P + i) % mod;
        len_to[j][i] = len_to[j][i - 1] + 1;
      } else {
        hash2[j][i] = hash2[j][i - 1];
        hash3[j][i] = hash3[j][i - 1];
        len_to[j][i] = len_to[j][i - 1];
      }
    }
  }
  for (int i = 1; i <= m; i++)
    something_stupid[b[i] - 'a'] = (something_stupid[b[i] - 'a'] * P + i) % mod;
  for (int i = 1; i <= n - m + 1; i++) {
    for (int j = 0; j <= 26 - 1; j++)
      cur[j] = ((get2(j, i, i + m - 1) - get(j, i, i + m - 1) * (i - 1)) % mod +
                mod) %
               mod;
    bool fail = 0;
    for (int j = 0; j <= 26 - 1; j++) {
      eq[j] = -1;
      if (cur[j] != something_stupid[j]) {
        for (int k = 0; k <= 26 - 1; k++) {
          if (cur[j] == something_stupid[k] and cur[k] == something_stupid[j]) {
            eq[j] = k;
            break;
          }
        }
      } else
        eq[j] = j;
      if (eq[j] == -1) {
        fail = 1;
        break;
      }
    }
    if (!fail) ans.push_back(i);
  }
  cout << ans.size() << '\n';
  for (__typeof(ans.begin()) it = ans.begin(); it != ans.end(); it++)
    cout << *it << ' ';
  cout << '\n';
  return 0;
}
