#include <bits/stdc++.h>
using namespace std;
long long th[50];
long long h[200005][50];
int n, m;
long long razy = 97, mod = 1000000007, dod = 7;
long long power[200005];
long long my[50];
pair<long long, long long> thp[50];
pair<long long, long long> myp[50];
long long para[50];
int main() {
  int alf = int('z' - 'a') + 1;
  ios_base::sync_with_stdio(0);
  string s, t;
  cin >> n >> m;
  cin >> s >> t;
  power[0] = 1;
  for (int i = 1; i < n; i++) {
    power[i] = (power[i - 1] * razy) % mod;
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < alf; j++) {
      th[j] = (th[j] * razy) % mod;
    }
    th[int(t[i] - 'a')] += dod;
  }
  for (int i = 0; i < n; i++) {
    if (i)
      for (int j = 0; j < alf; j++) {
        h[i][j] = (h[i - 1][j] * razy) % mod;
      }
    h[i][int(s[i] - 'a')] += dod;
  }
  for (int i = 0; i < alf; i++) {
    thp[i] = make_pair(th[i], i);
  }
  sort(thp, thp + alf);
  vector<int> ans;
  for (int i = 0; i <= n - m; i++) {
    for (int j = 0; j < alf; j++) {
      myp[j].first =
          (h[i + m - 1][j] - (i ? ((h[i - 1][j] * power[m]) % mod) : 0) + mod) %
          mod;
      myp[j].second = j;
      para[j] = -1;
    }
    sort(myp, myp + alf);
    bool good = 1;
    for (int j = alf - 1; j >= 0; j--) {
      if ((myp[j].first + mod - thp[j].first) % mod != 0) {
        good = 0;
        break;
      }
      if (myp[j].first == 0) break;
      int a = myp[j].second;
      int b = thp[j].second;
      if (para[a] != -1 && para[a] != b) {
        good = 0;
        break;
      }
      if (para[b] != -1 && para[b] != a) {
        good = 0;
        break;
      }
      para[a] = b;
      para[b] = a;
    }
    if (good) {
      ans.push_back(i + 1);
    }
  }
  cout << ans.size() << "\n";
  for (auto a : ans) cout << a << " ";
  cout << "\n";
  return 0;
}
