#include <bits/stdc++.h>
using namespace std;
inline int gcd(int x, int y) { return y ? gcd(y, ((y + x) % x)) : x; }
template <class Q>
vector<int> kmp(Q pattern, Q text, int n, int m) {
  vector<int> next(n + 1, 0);
  for (int i = 1; i < n; i++) {
    int j = i;
    while (j > 0) {
      j = next[j];
      if (pattern[j] == pattern[i]) {
        next[i + 1] = j + 1;
      }
    }
  }
  vector<int> pos;
  for (int i = 0, j = 0; i < m; i++) {
    if (j < n && pattern[j] == text[i]) {
      j++;
    } else {
      while (j > 0) {
        j = next[j];
        if (text[i] == pattern[j]) {
          j++;
          break;
        }
      }
    }
    if (j == n) {
      pos.push_back(i - n + 1);
    }
  }
  return pos;
}
unsigned int BDKHash(string str) {
  unsigned int tar = 0, hashs = 0, seed = 131;
  while (tar < str.length()) {
    hashs = hashs * seed + static_cast<int>(str[tar++]);
  }
  return hashs;
}
char s[200005], t[200005];
int m, n;
bool a[200005], b[200005];
int p[200005];
bool flag[200005][26][26], commit[200005][26];
int ans[200005];
bool vis[27];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  cin >> s + 1 >> t + 1;
  for (int letter = 'a'; letter <= 'z'; letter++) {
    for (int l2 = 'a'; l2 <= 'z'; l2++) {
      for (int i = 1; i <= n; i++) {
        a[i] = (letter == s[i]);
      }
      for (int i = 1; i <= m; i++) {
        b[i] = (l2 == t[i]);
      }
      p[1] = 0;
      for (int i = 2, j = 0; i <= m; i++) {
        for (; j > 0 && b[i] != b[j + 1]; j = p[j])
          ;
        if (b[i] == b[j + 1]) {
          j++;
        }
        p[i] = j;
      }
      for (int i = 1, j = 0; i <= n; i++) {
        for (; j > 0 && a[i] != b[j + 1]; j = p[j])
          ;
        if (a[i] == b[j + 1]) {
          if (++j == m)
            flag[i - m + 1][letter - 'a'][l2 - 'a'] = true, j = p[j];
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 26; j++) {
      for (int k = 0; k < 26; k++) {
        if (flag[i][j][k] && flag[i][k][j]) commit[i][k] = commit[i][j] = true;
      }
    }
  }
  for (int i = 1; i <= m; i++) {
    vis[t[i] - 'a'] = true;
  }
  int cnt = 0;
  for (int i = 0; i <= n; i++) {
    bool tmp = true;
    for (int j = 0; j < 26; j++) {
      if (vis[j]) tmp &= commit[i][j];
    }
    if (tmp) ans[++cnt] = i;
  }
  cout << cnt << endl;
  for (int i = 1; i <= cnt; i++) cout << ans[i] << ' ';
  cout << endl;
  return 0;
}
