#include <bits/stdc++.h>
using namespace std;
const int MAX = 200000 + 10;
int sl, tl;
string s, t;
int F[MAX], v[MAX];
char U[MAX][30];
void bff(string &pattern, char C) {
  int m = tl;
  F[0] = F[1] = 0;
  for (int i = 2; i <= m; i++) {
    int j = F[i - 1];
    for (;;) {
      if ((pattern[j] == C) == (pattern[i - 1] == C)) {
        F[i] = j + 1;
        break;
      }
      if (j == 0) {
        F[i] = 0;
        break;
      }
      j = F[j];
    }
  }
}
void kmp(string &text, string &pattern, char TC, char PC, int v[]) {
  int i = 0;
  int j = 0;
  int n = sl;
  int m = tl;
  for (;;) {
    if (j == n) break;
    if ((text[j] == TC) == (pattern[i] == PC)) {
      i++;
      j++;
      if (i == m) {
        v[j - m]++;
        if (U[j - m][TC - 'a'] && U[j - m][TC - 'a'] != PC) {
          v[j - m] += 100;
        }
        if (U[j - m][PC - 'a'] && U[j - m][PC - 'a'] != TC) {
          v[j - m] += 100;
        }
        U[j - m][TC - 'a'] = PC;
        U[j - m][PC - 'a'] = TC;
        if (i > 0) i = F[i];
      }
    } else if (i > 0)
      i = F[i];
    else
      j++;
  }
}
bool has(char c) {
  for (int i = 0; i < (tl); i++)
    if (t[i] == c) return true;
  return false;
}
int main() {
  cin >> sl >> tl >> s >> t;
  int need = 0;
  for (char i = 'a'; i <= 'z'; ++i) {
    if (!has(i)) continue;
    need++;
    bff(t, i);
    for (char j = 'a'; j <= 'z'; ++j) {
      kmp(s, t, j, i, v);
    }
  }
  vector<int> res;
  for (int i = 0; i < (sl); i++) {
    if (v[i] == need) res.push_back(i + 1);
  }
  cout << res.size() << endl;
  for (int i = 0; i < (res.size()); i++) {
    cout << res[i] << ' ';
  }
  cout << endl;
}
