#include <bits/stdc++.h>
using namespace std;
template <typename Int, Int mod>
class ModInt {
 public:
  static const Int Mod = mod;
  Int first;
  ModInt() : first(0) {}
  ModInt(int a) {
    Int t = a % mod;
    if (t < 0) t += mod;
    first = t;
  }
  ModInt(long long a) {
    Int t = a % mod;
    if (t < 0) t += mod;
    first = t;
  }
  Int get() const { return first; }
  ModInt &operator+=(ModInt that) {
    if ((first += that.first) >= mod) first -= mod;
    return *this;
  }
  ModInt &operator-=(ModInt that) {
    if ((first += mod - that.first) >= mod) first -= mod;
    return *this;
  }
  ModInt &operator*=(ModInt that) {
    first = (long long)(first)*that.first % mod;
    return *this;
  }
  bool operator==(ModInt that) const { return first == that.first; }
  ModInt operator+(ModInt that) const { return ModInt(*this) += that; }
  ModInt operator-(ModInt that) const { return ModInt(*this) -= that; }
  ModInt operator*(ModInt that) const { return ModInt(*this) *= that; }
  ModInt operator-() const { return ModInt(-this->first); }
  inline friend ostream &operator<<(ostream &out, ModInt m) {
    return out << m.first;
  }
  ModInt power(long long k) const {
    ModInt r(1);
    ModInt b = *this;
    if (k <= 0) return r;
    while (k) {
      if (k & 1) r *= b;
      b *= b;
      k >>= 1;
    }
    return r;
  }
  ModInt inverse() const {
    long long a = first, b = mod, u = 1, v = 0;
    while (b) {
      long long t = a / b;
      a -= t * b;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }
    return ModInt(u);
  }
  bool operator<(const ModInt &o) const { return first < o.first; }
};
int NT, NS;
char S[(200005)], T[(200005)];
const int P1 = 1000000007;
const int P2 = 1000000009;
const int m1 = 2;
const int m2 = 3;
const pair<ModInt<int, P1>, ModInt<int, P2> > HASH_ZERO;
void add(pair<ModInt<int, P1>, ModInt<int, P2> > &h, int v) {
  h.first = h.first * m1 + v;
  h.second = h.second * m2 + v;
}
vector<pair<pair<ModInt<int, P1>, ModInt<int, P2> >, int> > get_code(
    pair<ModInt<int, P1>, ModInt<int, P2> > h[26]) {
  vector<pair<pair<ModInt<int, P1>, ModInt<int, P2> >, int> > ret;
  for (int(i) = 0; (i) < (26); ++(i)) {
    if (h[i] != HASH_ZERO) {
      ret.push_back(make_pair(h[i], i));
    }
  }
  sort(ret.begin(), ret.end());
  return ret;
}
bool equal_(vector<pair<pair<ModInt<int, P1>, ModInt<int, P2> >, int> > &a,
            vector<pair<pair<ModInt<int, P1>, ModInt<int, P2> >, int> > &b) {
  if (((int)((a).size())) != ((int)((b).size()))) return false;
  for (int(i) = 0; (i) < (((int)((a).size()))); ++(i)) {
    if (a[i].first != b[i].first) return false;
  }
  return true;
}
int main() {
  scanf("%d %d", &NS, &NT);
  scanf("%s %s", S, T);
  ModInt<int, P1> head1 = ModInt<int, P1>(m1).power(NT);
  ModInt<int, P2> head2 = ModInt<int, P2>(m2).power(NT);
  pair<ModInt<int, P1>, ModInt<int, P2> > temp_S[26], temp_T[26];
  for (int(i) = 0; (i) < (26); ++(i)) {
    for (int(j) = 0; (j) < (NT); ++(j)) add(temp_T[i], i + 'a' == T[j]);
    for (int(j) = 0; (j) < (NT); ++(j)) add(temp_S[i], i + 'a' == S[j]);
  }
  vector<pair<pair<ModInt<int, P1>, ModInt<int, P2> >, int> > t_code =
      get_code(temp_T);
  int SZ_t_code = ((int)((t_code).size()));
  vector<int> ans;
  for (int(i) = 0; (i) < (NS - NT + 1); ++(i)) {
    if (i) {
      for (int(j) = 0; (j) < (26); ++(j))
        add(temp_S[j], j + 'a' == S[i + NT - 1]);
      temp_S[S[i - 1] - 'a'].first -= head1;
      temp_S[S[i - 1] - 'a'].second -= head2;
    }
    vector<pair<pair<ModInt<int, P1>, ModInt<int, P2> >, int> > s_code =
        get_code(temp_S);
    if (equal_(t_code, s_code)) {
      int used[26];
      memset(used, -1, sizeof(used));
      bool good = true;
      for (int(j) = 0; (j) < (SZ_t_code); ++(j)) {
        int cs = s_code[j].second;
        int ct = t_code[j].second;
        if (used[cs] == -1) {
          if (used[ct] != -1 && used[ct] != cs) {
            good = false;
            break;
          }
          used[cs] = ct;
          used[ct] = cs;
        } else {
          if (used[cs] != ct) {
            good = false;
            break;
          }
        }
      }
      if (good) ans.push_back(i + 1);
    }
  }
  cout << ((int)((ans).size())) << endl;
  for (int a : ans) cout << a << " ";
  return 0;
}
