#include <bits/stdc++.h>
using namespace std;
const int nmax = 200000 + 5;
const int B = 101;
int n, m;
unsigned long long mat[nmax], v1[26][nmax], v2[31][nmax];
string s, t;
int main() {
  cin >> n >> m;
  cin >> s >> t;
  s = " " + s;
  t = " " + t;
  mat[0] = 1;
  for (int i = 1; i <= n; i++) mat[i] = mat[i - 1] * B;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 26; j++) {
      v1[j][i] = v1[j][i - 1] * B + (s[i] - 'a' == j ? 1 : 2);
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 0; j < 26; j++) {
      v2[j][i] = v2[j][i - 1] * B + (t[i] - 'a' == j ? 1 : 2);
    }
    v2[26][i] = v2[26][i - 1] * B + 2;
  }
  vector<pair<unsigned long long, int> > vt;
  for (int j = 0; j < 26; j++)
    vt.push_back(make_pair(v2[j][m] - mat[m] * v2[j][0], j));
  sort(vt.begin(), vt.end());
  vector<int> sol;
  for (int i = 1; i + m - 1 <= n; i++) {
    int l = i, r = i + m - 1;
    vector<pair<unsigned long long, int> > vs;
    for (int j = 0; j < 26; j++) {
      vs.push_back(make_pair(v1[j][r] - mat[m] * v1[j][l - 1], j));
    }
    sort(vs.begin(), vs.end());
    bool issame = 1;
    for (int j = 0; j < vs.size(); j++) {
      if (vs[j].first != vt[j].first) {
        issame = 0;
        break;
      }
    }
    if (issame) {
      int H[26];
      memset(H, -1, sizeof(H));
      bool flag = 1;
      for (int j = 0; j < vs.size(); j++) {
        int a = vs[j].second, b = vt[j].second;
        if (a == b || vs[j].first == v2[26][m]) continue;
        if (H[a] != -1 && H[a] != b) {
          flag = 0;
          break;
        }
        H[a] = b;
        if (H[b] != -1 && H[b] != a) {
          flag = 0;
          break;
        }
        H[b] = a;
      }
      if (flag) sol.push_back(i);
    }
  }
  cout << sol.size() << endl;
  for (int i = 0; i < sol.size(); i++) {
    cout << sol[i] << " ";
  }
  cout << endl;
  return 0;
}
