#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 11;
int mk, n, m, pw[2][maxn], h[2][27][maxn], h1[2][27][27], beas = 29, mod[2];
string s, t;
vector<int> ans;
bool mark[30], l;
bool mark1[30];
void make_hash1(int ii, int o) {
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= 26; j++) {
      if ((t[i - 1] - 96) == ii) {
        h1[o][ii][j] =
            (h1[o][ii][j] + ((pw[o][i - 1] * (j)) % mod[o])) % mod[o];
      } else
        h1[o][ii][j] =
            (h1[o][ii][j] + ((pw[o][i - 1] * (27)) % mod[o])) % mod[o];
    }
  }
}
void make_hash(int o) {
  for (int j = 1; j <= 26; j++) {
    for (int i = 1; i <= n; i++) {
      if ((s[i - 1] - 96) == j)
        h[o][j][i] = (h[o][j][i - 1] + ((pw[o][i - 1] * j) % mod[o])) % mod[o];
      else
        h[o][j][i] = (h[o][j][i - 1] + ((pw[o][i - 1] * 27) % mod[o])) % mod[o];
    }
  }
}
bool aaa(int ii, int jj, int s1, int e1, int o) {
  int u1 = e1 - m;
  bool ll1 = 1;
  int xx = (h[o][jj][e1] - h[o][jj][s1 - 1] + mod[o]) % mod[o];
  int yy = (h1[o][ii][jj] * pw[o][u1]) % mod[o];
  if (xx != yy) ll1 = 0;
  xx = (h[o][ii][e1] - h[o][ii][s1 - 1] + mod[o]) % mod[o];
  yy = (h1[o][jj][ii] * pw[o][u1]) % mod[o];
  if (xx != yy) ll1 = 0;
  return ll1;
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m >> s >> t;
  mod[0] = 1e9 + 33;
  pw[0][0] = 1;
  for (int i = 1; i < maxn; i++) {
    pw[0][i] = (pw[0][i - 1] * beas) % mod[0];
  }
  for (int i = 0; i < m; i++) mark1[t[i] - 96] = 1;
  for (int i = 1; i <= 26; i++) {
    make_hash1(i, 0);
  }
  make_hash(0);
  for (int i = 1; i + m - 1 <= n; i++) {
    l = 1;
    for (int j = 0; j < 27; j++) mark[j] = 0;
    for (int j = 1; l && j <= 26; j++) {
      if (mark1[j]) {
        if (!mark[j]) {
          bool l1 = 0;
          for (int r = 1; r <= 26; r++) {
            if (!mark[r]) {
              if (aaa(j, r, i, i + m - 1, 0)) {
                l1 = 1;
                mark[j] = 1;
                mark[r] = 1;
                r = 27;
              }
            }
          }
          if (l1 == 0) {
            l = 0;
          }
        }
      }
    }
    if (l) ans.push_back(i);
  }
  cout << ans.size() << endl;
  for (int i = 0; i < ans.size(); i++) cout << ans[i] << ' ';
  return 0;
}
