#include <bits/stdc++.h>
using namespace std;
const int kMaxN = 200010;
int n, m;
char s[kMaxN], t[kMaxN];
int nex[26][kMaxN];
int buf[kMaxN], str[kMaxN];
int ex[kMaxN];
int rec[kMaxN][26];
bool ban[kMaxN];
int main() {
  scanf("%d%d%s%s", &n, &m, s, t);
  for (int _ = 0; _ < 26; ++_) {
    char c = 'a' + _;
    for (int i = 0; i < m; ++i) buf[i] = (t[i] == c);
    nex[_][0] = m;
    nex[_][1] = m - 1;
    for (int i = 0; i < m - 1; ++i)
      if (buf[i] != buf[i + 1]) {
        nex[_][1] = i;
        break;
      }
    int j, k = 1, p, l;
    for (int i = 2; i < m; ++i) {
      p = k + nex[_][k] - 1;
      l = nex[_][i - k];
      if (i + l - 1 < p)
        nex[_][i] = l;
      else {
        j = max(0, p + 1 - i);
        while (i + j < m && buf[i + j] == buf[j]) ++j;
        nex[_][i] = j, k = i;
      }
    }
  }
  memset(rec, -1, sizeof(rec));
  for (int _ = 0; _ < 26; ++_) {
    char c = 'a' + _;
    for (int i = 0; i < n; ++i) str[i] = (s[i] == c);
    for (int o = 0; o < 26; ++o) {
      int *ne = nex[o];
      int tot = 0;
      for (int i = 0; i < m; ++i) {
        buf[i] = (t[i] == 'a' + o);
        tot += buf[i];
      }
      if (tot == 0) continue;
      ex[0] = m;
      for (int i = 0; i < m; ++i)
        if (str[i] != buf[i]) {
          ex[0] = i;
          break;
        }
      int j, k = 0, p, l;
      for (int i = 1; i < n; ++i) {
        p = k + ex[k] - 1;
        l = ne[i - k];
        if (i + l - 1 < p)
          ex[i] = l;
        else {
          j = max(0, p + 1 - i);
          while (i + j < n && j < m && str[i + j] == buf[j]) ++j;
          ex[i] = j, k = i;
        }
      }
      for (int i = 0; i < n - m + 1; ++i) {
        if (ex[i] == m) {
          if (rec[i][o] != -1) {
            ban[i] = true;
          } else {
            rec[i][o] = _;
          }
        }
      }
    }
  }
  bool has[26];
  memset(has, 0, sizeof(has));
  for (int i = 0; i < m; ++i) has[t[i] - 'a'] = true;
  for (int i = 0; i < n - m + 1; ++i) {
    for (int j = 0; j < 26; ++j) {
      if (rec[i][j] != -1) {
        if (rec[i][rec[i][j]] == -1) {
          if (!has[rec[i][j]]) {
            rec[i][rec[i][j]] = j;
          } else {
            ban[i] = true;
            break;
          }
        } else if (rec[i][rec[i][j]] != j) {
          ban[i] = true;
          break;
        }
      } else if (has[j]) {
        ban[i] = true;
        break;
      }
    }
  }
  vector<int> ans;
  for (int i = 0; i < n - m + 1; ++i)
    if (!ban[i]) ans.push_back(i);
  printf("%d\n", ans.size());
  for (int x : ans) printf("%d ", x + 1);
  puts("");
  return 0;
}
