#include <bits/stdc++.h>
using namespace std;
const unsigned long long base = 233;
unsigned long long mul[200010];
int n, m;
int match[30], nxt[200010][30];
int cnt, pos[200010];
string s1, s2;
unsigned long long hash1[200010][30], hash2;
void init() {
  s1 = ' ' + s1, s2 = ' ' + s2;
  mul[0] = 1;
  for (int i = 1; i <= n; i++) mul[i] = mul[i - 1] * base;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= 26; j++)
      hash1[i][j] = hash1[i - 1][j] * base + (s1[i] == 'a' + j - 1);
  for (int i = 1; i <= m; i++) (hash2 *= base) += (s2[i] - 'a' + 1);
  for (int i = 1; i <= 26; i++) nxt[n + 1][i] = n + 1;
  for (int i = n; i >= 1; i--)
    for (int j = 1; j <= 26; j++) {
      if (s1[i] - 'a' + 1 == j)
        nxt[i][j] = i;
      else
        nxt[i][j] = nxt[i + 1][j];
    }
}
inline unsigned long long gethash1(int st, int len, int let) {
  return hash1[st + len - 1][let] - hash1[st - 1][let] * mul[len];
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  cin >> s1 >> s2;
  init();
  for (int i = 1; i <= n - m + 1; i++) {
    int r = i + m - 1;
    unsigned long long tmp = 0;
    memset(match, 0, sizeof match);
    for (int j = 1; j <= 26; j++) {
      if (nxt[i][j] > r) continue;
      unsigned long long k = s2[nxt[i][j] - i + 1] - 'a' + 1;
      if (!match[j] && !match[k]) match[j] = k, match[k] = j;
      tmp += match[j] * gethash1(i, m, j);
    }
    if (tmp == hash2) pos[++cnt] = i;
  }
  cout << cnt << endl;
  for (int i = 1; i <= cnt; i++) cout << pos[i] << ' ';
  cout << endl;
  return 0;
}
