#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y) {
  long long int res = 1;
  while (y) {
    if (y & 1) res = (res * x) % 1000000007;
    y = y / 2, x = (x * x) % 1000000007;
  }
  return res % 1000000007;
}
long long int binpower(long long int x, long long int y, long long int pp) {
  long long int res = 1;
  while (y) {
    if (y & 1) res = (res * x) % pp;
    y = y / 2, x = (x * x) % pp;
  }
  return res % pp;
}
long long int hash1[200001][26];
long long int hash2[200001][26];
long long int pwr1[200001];
long long int pwr2[200001];
long long int inv1[200001];
long long int inv2[200001];
long long int mod1 = 1e9 + 21;
long long int mod2 = 1e9 + 9;
vector<long long int> fin;
void hashing(string s) {
  long long int p1 = 31;
  long long int p2 = 43;
  long long int i;
  pwr1[0] = 1;
  pwr2[0] = 1;
  for (i = 1; i <= s.length(); i++) {
    pwr1[i] = (p1 * pwr1[i - 1]) % mod1;
    pwr2[i] = (p2 * pwr2[i - 1]) % mod2;
  }
  for (i = 0; i <= s.length(); i++) {
    inv1[i] = binpower(pwr1[i], mod1 - 2, mod1);
    inv2[i] = binpower(pwr2[i], mod2 - 2, mod2);
  }
  for (i = 0; i <= 200000; i++) {
    for (long long int j = 0; j < 26; j++) {
      hash1[i][j] = 0;
      hash2[i][j] = 0;
    }
  }
  for (i = 0; i < s.length(); i++) {
    hash1[i + 1][s[i] - 'a'] = pwr1[i];
    hash2[i + 1][s[i] - 'a'] = pwr2[i];
    for (long long int j = 0; j < 26; j++) {
      hash1[i + 1][j] += hash1[i][j];
      hash2[i + 1][j] += hash2[i][j];
      hash1[i + 1][j] %= mod1;
      hash2[i + 1][j] %= mod2;
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, m;
  cin >> n >> m;
  long long int i;
  string s, t;
  cin >> s >> t;
  hashing(t);
  vector<pair<pair<long long int, long long int>, long long int> > arr;
  for (i = 0; i < 26; i++)
    arr.push_back(make_pair(make_pair(hash1[m][i], hash2[m][i]), i));
  sort(arr.begin(), arr.end());
  reverse(arr.begin(), arr.end());
  long long int ans = 0;
  hashing(s);
  for (long long int j = 1; j <= n - m + 1; j++) {
    long long int x, l;
    x = j;
    l = m;
    vector<pair<pair<long long int, long long int>, long long int> > temp1;
    long long int freq[26];
    for (i = 0; i < 26; i++) {
      freq[i] = -1;
      temp1.push_back(
          make_pair(make_pair((hash1[x + l - 1][i] - hash1[x - 1][i] + mod1) %
                                  mod1 * inv1[x - 1] % mod1,
                              (hash2[x + l - 1][i] - hash2[x - 1][i] + mod2) %
                                  mod2 * inv2[x - 1] % mod2),
                    i));
    }
    sort(temp1.begin(), temp1.end());
    reverse(temp1.begin(), temp1.end());
    vector<pair<pair<long long int, long long int>, long long int> > temp2 =
        arr;
    bool poss = true;
    long long int cnt = 0;
    while (cnt < 26) {
      pair<pair<long long int, long long int>, long long int> sad = temp1[cnt];
      pair<pair<long long int, long long int>, long long int> hola = temp2[cnt];
      if (sad.first.first == 0 and hola.first.first == 0 and
          sad.first.second == 0 and hola.first.second == 0)
        break;
      if (sad.first.first == hola.first.first and
          sad.first.second == hola.first.second) {
        if (freq[sad.second] == -1 and freq[hola.second] == -1)
          freq[sad.second] = hola.second, freq[hola.second] = sad.second;
        else if (freq[sad.second] != hola.second or
                 freq[hola.second] != sad.second) {
          poss = false;
          break;
        }
      } else {
        poss = false;
        break;
      }
      cnt++;
    }
    if (poss) ans++, fin.push_back(j);
  }
  cout << ans << "\n";
  for (i = 0; i < ans; i++) cout << fin[i] << " ";
}
