#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
const int modulo = 1e9 + 7;
const int base = 31;
const int nAlphabet = 26;
const int inversion = 129032259;
int tHash[nAlphabet], sHash[maxn];
int p[maxn];
char s[maxn], t[maxn];
int n, m;
inline void add(int &a, int b) {
  a += b;
  if (a >= modulo) a -= modulo;
}
bool isTheSame() {
  for (int i = 0; i < nAlphabet; ++i)
    if (tHash[i] != 0) {
      int nxt = -1;
      for (int j = 0; j < nAlphabet; ++j)
        if (tHash[i] == sHash[j]) {
          nxt = j;
          break;
        }
      if (nxt == -1 || tHash[nxt] != sHash[i]) return false;
    }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  cin >> (s + 1);
  cin >> (t + 1);
  p[0] = 1;
  for (int i = 1; i <= n; ++i) {
    p[i] = 1ll * p[i - 1] * base % modulo;
  }
  for (int i = 1; i <= m; ++i) {
    int c = t[i] - 'a';
    add(tHash[c], p[i]);
  }
  for (int i = 1; i < m; ++i) {
    int c = s[i] - 'a';
    add(sHash[c], p[i]);
  }
  vector<int> ans;
  for (int i = m; i <= n; ++i) {
    int c = s[i] - 'a';
    add(sHash[c], p[m]);
    if (isTheSame()) ans.push_back(i - m + 1);
    c = s[i - m + 1] - 'a';
    add(sHash[c], modulo - p[1]);
    for (int j = 0; j < nAlphabet; ++j)
      sHash[j] = 1ll * sHash[j] * inversion % modulo;
  }
  cout << ans.size() << '\n';
  for (int x : ans) cout << x << ' ';
  return 0;
}
