#include <bits/stdc++.h>
using namespace std;
const unsigned long long mmod = 235392958149153127LL;
bool poss(unsigned long long* s, unsigned long long* t) {
  for (int i = 0; i < 26; i++) {
    if (s[i] == t[i]) continue;
    if (s[i] == 0) continue;
    int found = 0;
    for (int j = 0; j < 26; j++)
      if (s[i] == t[j]) {
        if (t[i] != s[j]) return false;
        found = 1;
        break;
      }
    if (!found) return false;
  }
  return true;
}
int main() {
  int s_len, t_len;
  cin >> s_len >> t_len;
  string S, T;
  cin >> S >> T;
  unsigned long long t_state[26] = {0};
  for (int i = 0; i < t_len; i++) {
    for (int j = 0; j < 26; j++) t_state[j] = (t_state[j] * 37u) % mmod;
    t_state[T[i] - 'a'] = (t_state[T[i] - 'a'] + 1) % mmod;
  }
  unsigned long long s_state[26] = {0};
  for (int i = 0; i < t_len; i++) {
    for (int j = 0; j < 26; j++) s_state[j] = (s_state[j] * 37u) % mmod;
    s_state[S[i] - 'a'] = (s_state[S[i] - 'a'] + 1) % mmod;
  }
  unsigned long long mult = 1;
  for (int i = 0; i < t_len - 1; i++) mult = (mult * 37u) % mmod;
  vector<int> res;
  for (int i = 0; i <= s_len - t_len; i++) {
    if (poss(s_state, t_state)) res.push_back(i + 1);
    if (i == s_len - t_len) break;
    s_state[S[i] - 'a'] = (s_state[S[i] - 'a'] - mult + mmod) % mmod;
    for (int j = 0; j < 26; j++) s_state[j] = (s_state[j] * 37u) % mmod;
    s_state[S[i + t_len] - 'a'] = (s_state[S[i + t_len] - 'a'] + 1) % mmod;
  }
  printf("%d\n", res.size());
  for (int i = 0; i < res.size(); i++) printf("%d ", res[i]);
  printf("\n");
}
