#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
const int A = 26;
vector<int> pos[2][A], dis[2][A];
int f[N];
int mt[N][A];
int cnt[N];
int sz[2];
string s[2];
bool mark[A];
void update(int i, int a, int b) {
  cnt[i]++;
  if (mt[i][a] == b && mt[i][b] == a) return;
  if (mt[i][a] != -1 || mt[i][b] != -1) cnt[i] = -1;
  mt[i][a] = b;
  mt[i][b] = a;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> sz[0] >> sz[1];
  for (int x = 0; x < 2; x++) {
    cin >> s[x];
    for (int i = 0; i < sz[x]; i++) pos[x][s[x][i] - 'a'].push_back(i);
    for (int i = 0; i < A; i++)
      for (int j = 0; j + 1 < (int)pos[x][i].size(); j++)
        dis[x][i].push_back(pos[x][i][j + 1] - pos[x][i][j]);
  }
  for (int a = 0; a < A; a++)
    if (pos[1][a].size()) mark[a] = 1;
  int dif = 0;
  memset(mt, -1, sizeof mt);
  for (int a = 0; a < A; a++) {
    if (pos[1][a].empty()) continue;
    dif++;
    if (dis[1][a].empty()) {
      int prv = pos[1][a][0];
      int nxt = sz[1] - pos[1][a][0];
      for (int b = 0; b < A; b++)
        for (int i = 0; i < (int)pos[0][b].size(); i++) {
          bool flag = true;
          if (i > 0 && pos[0][b][i - 1] >= pos[0][b][i] - prv) flag = false;
          if (i + 1 < (int)pos[0][b].size() &&
              pos[0][b][i + 1] < pos[0][b][i] + nxt)
            flag = false;
          if (flag && pos[0][b][i] - prv >= 0) update(pos[0][b][i] - prv, a, b);
        }
      continue;
    }
    for (int i = 1; i < (int)dis[1][a].size(); i++) {
      int state = f[i];
      while (state && dis[1][a][state] != dis[1][a][i]) state = f[state];
      if (dis[1][a][state] == dis[1][a][i]) state++;
      f[i + 1] = state;
    }
    for (int b = 0; b < A; b++) {
      int state = 0;
      for (int i = 0; i < (int)dis[0][b].size(); i++) {
        while (state && dis[1][a][state] != dis[0][b][i]) state = f[state];
        if (dis[1][a][state] == dis[0][b][i]) state++;
        if (state == (int)dis[1][a].size()) {
          if (pos[0][b][i + 1] - pos[1][a].back() >= 0)
            update(pos[0][b][i + 1] - pos[1][a].back(), a, b);
          state = f[state];
        }
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < sz[0]; i++)
    if (cnt[i] == dif) ans++;
  cout << ans << "\n";
  for (int i = 0; i < sz[0]; i++)
    if (cnt[i] == dif) cout << i + 1 << " ";
  cout << "\n";
}
