#include <bits/stdc++.h>
using namespace std;
using LD = long double;
using PLL = pair<long long, long long>;
template <class T>
bool power_2(T v) {
  static_assert(std::is_integral<T>::value, "type should be integral");
  return v && !(v & (v - 1));
}
template <class T>
istream& operator>>(istream& st, vector<T>& container) {
  for (auto& u : container) st >> u;
  return st;
}
template <class T, size_t N>
istream& operator>>(istream& st, array<T, N>& container) {
  for (auto& u : container) st >> u;
  return st;
}
template <class T>
ostream& operator<<(ostream& st, const vector<T>& container) {
  for (auto& u : container) st << u << ' ';
  return st;
}
template <class T, class U>
istream& operator>>(istream& st, pair<T, U>& p) {
  st >> p.first >> p.second;
  return st;
}
template <class T, class U>
ostream& operator<<(ostream& st, pair<T, U> p) {
  st << p.first << ' ' << p.second;
  return st;
}
template <class T, class U, class V>
pair<T, U> operator*(pair<T, U> p, V val) {
  return {p.first * val, p.second * val};
}
template <class T, class U, class V>
pair<T, U> operator/(pair<T, U> p, V val) {
  return {p.first / val, p.second / val};
}
template <class T, class U>
pair<T, U> operator-(pair<T, U> a, pair<T, U> b) {
  return {a.first - b.first, a.second - b.second};
}
template <class T, class U>
pair<T, U> operator+(pair<T, U> a, pair<T, U> b) {
  return {a.first + b.first, a.second + b.second};
}
template <class T>
T dotProduct(pair<T, T> a, pair<T, T> b) {
  return a.first * b.first + a.second * b.second;
}
template <class T>
T crossProduct(pair<T, T> a, pair<T, T> b) {
  return a.first * b.second - a.second * b.first;
}
template <class T>
T lengthPow(pair<T, T> a) {
  return a.first * a.first + a.second * a.second;
}
template <class T>
LD length(pair<T, T> a) {
  return sqrt(lengthPow(a));
}
const int N = 2e5 + 7, inf = 1e9 + 7, MOD = 114962203;
const long long INF = 1e18 + 7;
const int M = 1 << 16;
const long double PI = acos(-1);
const LD eps = 1e-4;
int hashTAB[N][26];
int hashT[26];
bitset<26> tHas;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cout << fixed << setprecision(15);
  int n, m;
  cin >> n >> m;
  string s, t;
  cin >> s >> t;
  int pow2 = 1;
  for (int i = 1; i < m; ++i) {
    pow2 *= 2;
    if (pow2 >= MOD) pow2 -= MOD;
  }
  for (int i = 0; i < 26; ++i) {
    int hash = 0;
    for (int j = 0; j < m - 1; ++j) {
      if (s[j] - 'a' == i) ++hash;
      hash *= 2;
      if (hash >= MOD) hash -= MOD;
    }
    for (int j = m - 1; j < n; ++j) {
      if (s[j] - 'a' == i) {
        ++hash;
      }
      hashTAB[j - m + 1][i] = hash;
      if (s[j - m + 1] - 'a' == i) {
        hash -= pow2;
        if (hash < 0) hash += MOD;
      }
      hash *= 2;
      if (hash >= MOD) hash -= MOD;
    }
  }
  for (int i = 0; i < 26; ++i) {
    int hash = 0;
    for (int j = 0; j < m; ++j) {
      hash *= 2;
      if (t[j] - 'a' == i) {
        tHas[i] = 1;
        ++hash;
      }
      if (hash >= MOD) hash -= MOD;
    }
    hashT[i] = hash;
  }
  vector<int> res;
  for (int j = 0; j < n - m + 1; ++j) {
    vector<pair<int, unsigned char> > hashe;
    for (int i = 0; i < 26; ++i) {
      hashe.emplace_back(hashTAB[j][i], i + 'a');
    }
    sort(begin((hashe)), end((hashe)));
    bool ok = 1;
    bitset<26> checked;
    for (int i = 0; i < 26; ++i) {
      if (!tHas[i] || checked[i]) continue;
      bool finded = false;
      auto it = lower_bound(begin((hashe)), end((hashe)),
                            pair<int, unsigned char>{hashT[i], 0});
      while (it != hashe.end() && it->first == hashT[i]) {
        int index = it->second - 'a';
        if (hashT[index] == hashTAB[j][i]) {
          finded = true;
          break;
        }
        ++it;
      }
      if (!finded) {
        ok = false;
        break;
      }
    }
    if (ok) res.push_back(j + 1);
  }
  cout << res.size() << '\n' << res;
  return 0;
}
