#include <bits/stdc++.h>
using namespace std;
template <typename T>
vector<T> readVector(size_t n, istream& in = cin) {
  vector<T> result(n);
  for (int i = 0; i < n; ++i) {
    cin >> result[i];
  }
  return result;
}
template <typename T>
void writeVector(const vector<T>& vec, int n = -1, ostream& out = cout) {
  int size = (n == -1 ? vec.size() : n);
  for (int i = 0; i < size; ++i) {
    out << vec[i] << ' ';
  }
}
const unsigned long long P1 = 200371;
const unsigned long long P2 = 200381;
const unsigned long long P1R =
    14925612669 * ((unsigned long long)1e9) + 528461435;
const unsigned long long P2R =
    8136208961 * ((unsigned long long)1e9) + 820351637;
unsigned long long p1[200500];
unsigned long long p2[200500];
pair<unsigned long long, unsigned long long> hashm(const vector<int>& v) {
  unsigned long long h1 = 0, h2 = 0;
  for (int i = 0; i < v.size(); ++i) {
    h1 += p1[i] * v[i];
    h2 += p2[i] * v[i];
  }
  return make_pair(h1, h2);
}
bool was[26];
bool cmp(const vector<pair<unsigned long long, unsigned long long>>& h1,
         const vector<pair<unsigned long long, unsigned long long>>& h2,
         const vector<int>& len1, const vector<int>& len2) {
  memset(was, false, sizeof(was));
  for (int i = 0; i < 26; ++i) {
    if (h1[i] != h2[i]) {
      bool good = false;
      for (int j = 0; j < 26; ++j) {
        if (h1[i] == h2[j] && len1[i] == len2[j] && h1[j] == h2[i] &&
            len1[j] == len2[i]) {
          good = true;
          break;
        }
      }
      if (!good) return false;
    }
  }
  return true;
}
unsigned long long sum1[200005];
unsigned long long sum2[200005];
int main() {
  std::ios_base::sync_with_stdio(false);
  int s_len, t_len;
  cin >> s_len >> t_len;
  string s, t;
  cin >> s >> t;
  p1[0] = 1, p2[0] = 1;
  sum1[0] = 1, sum2[0] = 1;
  for (int i = 1; i < t.size() + 5; ++i) {
    p1[i] = p1[i - 1] * P1;
    sum1[i] = sum1[i - 1] + p1[i];
    p2[i] = p2[i - 1] * P2;
    sum2[i] = sum2[i - 1] + p2[i];
  }
  vector<vector<int>> pos(26);
  vector<int> lent(26, 0);
  for (int i = 0; i < t.size(); ++i) {
    pos[t[i] - 'a'].push_back(i);
    lent[t[i] - 'a']++;
  }
  vector<pair<unsigned long long, unsigned long long>> templ(26);
  for (int i = 0; i < 26; ++i) {
    templ[i] = hashm(pos[i]);
  }
  pos.assign(26, vector<int>());
  vector<int> len(26, 0);
  for (int i = 0; i < t.size(); ++i) {
    pos[s[i] - 'a'].push_back(i);
    len[s[i] - 'a']++;
  }
  vector<pair<unsigned long long, unsigned long long>> cur(26);
  for (int i = 0; i < 26; ++i) {
    cur[i] = hashm(pos[i]);
  }
  vector<int> ans;
  for (int i = 0; i < s.size() - t.size() + 1; ++i) {
    if (cmp(cur, templ, len, lent)) {
      ans.push_back(i + 1);
    }
    if (i + t.size() == s.size()) {
      break;
    }
    int was = s[i] - 'a';
    int next = s[i + t.size()] - 'a';
    for (int i = 0; i < 26; ++i) {
      cur[i].first -= sum1[len[i] - 1];
      cur[i].second -= sum2[len[i] - 1];
    }
    len[was]--;
    cur[was].first += 1;
    cur[was].second += 1;
    cur[was].first *= P1R;
    cur[was].second *= P2R;
    len[next]++;
    cur[next].first += p1[len[next] - 1] * (t.size() - 1);
    cur[next].second += p2[len[next] - 1] * (t.size() - 1);
  }
  cout << ans.size() << endl;
  writeVector(ans);
  return 0;
}
