#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)2e5 + 123;
const int Q1 = (int)1e9 + 7;
const int Q2 = (int)1e9 + 9;
int P1, P2;
int add(int a, int b, int Q) {
  if ((a += b) >= Q) a -= Q;
  return a;
}
int mult(long long a, long long b, int Q) { return (a * b) % Q; }
struct hash_t {
  int x, y;
  hash_t() {}
  hash_t(int a) : x(a), y(a) {}
  hash_t(int x, int y) : x(x), y(y) {}
};
hash_t operator+(const hash_t &a, const hash_t &b) {
  return hash_t(add(a.x, b.x, Q1), add(a.y, b.y, Q2));
}
hash_t operator+(const hash_t &a, const int &b) {
  return hash_t(add(a.x, b, Q1), add(a.y, b, Q2));
}
hash_t operator-(const hash_t &a, const hash_t &b) {
  return hash_t(add(a.x, Q1 - b.x, Q1), add(a.y, Q2 - b.y, Q2));
}
hash_t operator*(const hash_t &a, const hash_t &b) {
  return hash_t(mult(a.x, b.x, Q1), mult(a.y, b.y, Q2));
}
bool operator==(const hash_t &a, const hash_t &b) {
  return a.x == b.x && a.y == b.y;
}
bool operator<(const hash_t &a, const hash_t &b) {
  if (a.x != b.x) return a.x < b.x;
  return a.y < b.y;
}
hash_t st[maxn];
hash_t h[maxn];
char S[maxn];
char T[maxn];
hash_t hS[26][maxn];
hash_t hT[26][maxn];
int cT[26];
int solve() {
  int n, m;
  if (scanf("%d%d", &n, &m) != 2) return 0;
  scanf("%s", S);
  scanf("%s", T);
  memset(cT, -1, sizeof cT);
  for (int i = 0; i < m; i++) {
    if (cT[T[i] - 'a'] == -1) cT[T[i] - 'a'] = i;
  }
  for (int k = 0; k < 26; k++) {
    hS[k][0] = 0;
    for (int i = 0; i < n; i++) {
      hS[k][i + 1] = hS[k][i] * st[1] + (S[i] == k + 'a');
    }
    hT[k][0] = 0;
    for (int i = 0; i < m; i++) {
      hT[k][i + 1] = hT[k][i] * st[1] + (T[i] == k + 'a');
    }
  }
  vector<int> res;
  for (int i = 0; i + m <= n; i++) {
    int ok = 1;
    for (int k = 0; k < 26 && ok; k++) {
      if (cT[k] == -1) continue;
      int l = S[i + cT[k]] - 'a';
      auto h1 = hT[k][m];
      auto h2 = hS[l][m + i] - hS[l][i] * st[m];
      ok &= h1 == h2;
      h1 = hT[l][m];
      h2 = hS[k][m + i] - hS[k][i] * st[m];
      ok &= h1 == h2;
    }
    if (ok) res.push_back(i + 1);
  }
  printf("%d\n", (int)res.size());
  for (int i = 0; i < (int)res.size(); i++) {
    printf("%d%c", res[i], " \n"[i + 1 == (int)res.size()]);
  }
  return 1;
}
int main() {
  srand(time(NULL));
  P1 = rand();
  P2 = rand();
  st[0] = 1;
  for (int i = 0; i + 1 < maxn; i++)
    st[i + 1] = hash_t(mult(st[i].x, P1, Q1), mult(st[i].y, P2, Q2));
  while (solve())
    ;
}
