#include <bits/stdc++.h>
using namespace std;
const long long base = 47;
long long n, m;
char a[200005], b[200005];
long long power[200005];
long long code[2][200005];
deque<long long> d[35];
bool sign[35];
vector<long long> res;
bool check(long long i, long long j) {
  if (code[0][i] == code[1][j] && code[0][j] == code[1][i]) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  cin >> (a + 1);
  cin >> (b + 1);
  power[0] = 1;
  for (long long i = 1; i <= 200001; i++) power[i] = power[i - 1] * base;
  for (long long i = 1; i <= m; i++) {
    code[0][b[i] - 'a'] = (code[0][b[i] - 'a'] + power[i]);
    sign[b[i] - 'a'] = true;
  }
  for (long long i = 1; i <= m - 1; i++) {
    d[a[i] - 'a'].push_back(i);
    code[1][a[i] - 'a'] += power[i];
  }
  for (long long i = m; i <= n; i++) {
    code[1][a[i] - 'a'] += power[i];
    d[a[i] - 'a'].push_back(i);
    for (long long j = 0; j < 26; j++) {
      if (d[j].empty() == false && d[j].front() <= i - m) {
        code[1][j] -= power[d[j].front()];
        d[j].pop_front();
      }
    }
    if (i > m)
      for (long long j = 0; j < 26; j++) code[0][j] *= base;
    bool ok = true;
    for (long long j = 0; j < 26; j++) {
      if (!sign[j]) continue;
      bool have = false;
      for (long long k = 0; k < 26; k++) {
        if (d[k].empty()) continue;
        if (check(j, k)) {
          have = true;
          break;
        }
      }
      if (!have) {
        ok = false;
        break;
      }
    }
    if (ok) res.push_back(i - m + 1);
  }
  cout << (long long)res.size() << "\n";
  if (!res.empty()) {
    for (long long i = 0; i < (long long)res.size(); i++) cout << res[i] << " ";
    cout << "\n";
  }
  return 0;
}
