#include <bits/stdc++.h>
using namespace std;
template <int BASE, long long MODULO>
class StringHash {
  template <int B, long long M>
  friend class StringHasher;
  vector<long long> hash;

 public:
  size_t getSize() const { return hash.size(); }
};
template <int BASE, long long MODULO>
class StringHasher {
  static long long getBasePower(int n) {
    static vector<long long> power;
    if (n > (int)power.size() - 1) {
      int cur = (int)power.size() - 1;
      power.resize(n + 1);
      for (auto i = cur + 1; i <= n; ++i) {
        if (i == 0) {
          power[i] = 1;
        } else {
          power[i] = (power[i - 1] * BASE) % MODULO;
        }
      }
    }
    return power[n];
  }

 public:
  template <class Iterator>
  static StringHash<BASE, MODULO> getHash(Iterator begin, Iterator end) {
    StringHash<BASE, MODULO> h;
    int n = (int)(end - begin);
    h.hash.resize(n);
    int idx = 0;
    long long last = 0;
    for (auto it = begin; it != end; ++it) {
      h.hash[idx] = (last * BASE + *it) % MODULO;
      last = h.hash[idx];
      idx++;
    }
    return h;
  }
  static long long getHashValue(const StringHash<BASE, MODULO> &sh) {
    return sh.hash[sh.getSize() - 1];
  }
  static long long getHashValue(const StringHash<BASE, MODULO> &sh, int first,
                                int len) {
    if (len == 0) return 0;
    assert(0 <= first && first < sh.getSize());
    assert(len >= 1);
    assert(first + len - 1 < sh.getSize());
    int last = first + len - 1;
    if (first == 0) return sh.hash[last];
    long long ret =
        (sh.hash[last] - sh.hash[first - 1] * getBasePower(len)) % MODULO;
    if (ret < 0) ret += MODULO;
    return ret;
  }
  static long long getHashValueConcat(const StringHash<BASE, MODULO> &sh1,
                                      const StringHash<BASE, MODULO> &sh2) {
    return (getHashValue(sh1) * getBasePower((int)sh2.getSize()) +
            getHashValue(sh2)) %
           MODULO;
  }
};
class BinarySearch {
 public:
  template <class T>
  static T binarySearchMin(const T &minIndex, const T &maxIndex,
                           const function<bool(T)> &predicate) {
    T leftIndex = minIndex, rightIndex = maxIndex, midIndex, ret = maxIndex + 1;
    while (leftIndex <= rightIndex) {
      midIndex = leftIndex + (rightIndex - leftIndex) / 2;
      if (predicate(midIndex)) {
        ret = midIndex;
        rightIndex = midIndex - 1;
      } else {
        leftIndex = midIndex + 1;
      }
    }
    return ret;
  }
  template <class T>
  static T binarySearchMax(const T &minIndex, const T &maxIndex,
                           const function<bool(T)> &predicate) {
    T leftIndex = minIndex, rightIndex = maxIndex, midIndex, ret = minIndex - 1;
    while (leftIndex <= rightIndex) {
      midIndex = leftIndex + (rightIndex - leftIndex) / 2;
      if (predicate(midIndex)) {
        ret = midIndex;
        leftIndex = midIndex + 1;
      } else {
        rightIndex = midIndex - 1;
      }
    }
    return ret;
  }
  static double binarySearchMaxReal(double minRange, double maxRange,
                                    double epsilon,
                                    const function<bool(double)> &predicate) {
    double l = minRange, r = maxRange, m, ret = maxRange + 1;
    while (r - l > epsilon) {
      m = l + (r - l) / 2;
      if (predicate(m)) {
        ret = m;
        l = m;
      } else {
        r = m;
      }
    }
    return ret;
  }
  static double binarySearchMinReal(double minRange, double maxRange,
                                    double epsilon,
                                    const function<bool(double)> &predicate) {
    double l = minRange, r = maxRange, m, ret = maxRange + 1;
    while (r - l > epsilon) {
      m = l + (r - l) / 2;
      if (predicate(m)) {
        l = m;
        ret = m;
      } else {
        r = m;
      }
    }
    return ret;
  }
};
void testGen() {
  freopen("biginput1.txt", "w", stdout);
  fclose(stdout);
}
int lenS, lenT;
string s, t;
pair<StringHash<3, 1000001927>, StringHash<5, 1000001963>> hashS[26], hashT[26];
vector<long long> hT(26), htSorted(26);
bool check(int i) {
  vector<long long> hS(26);
  for (auto c = 0; c < 26; ++c) {
    hS[c] = StringHasher<3, 1000001927>::getHashValue(hashS[c].first, i, lenT) *
                1000001927 +
            StringHasher<5, 1000001963>::getHashValue(hashS[c].second, i, lenT);
  }
  vector<long long> hsSorted = hS;
  sort(hsSorted.begin(), hsSorted.end());
  for (auto c = 0; c < 26; ++c) {
    if (hsSorted[c] != htSorted[c]) {
      return false;
    }
  }
  for (auto c1 = 0; c1 < 26; ++c1) {
    if (hS[c1] == 0) continue;
    for (auto c2 = 0; c2 < 26; ++c2) {
      if (hS[c1] == hT[c2] && hS[c2] != hT[c1]) {
        return false;
      }
    }
  }
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> lenS >> lenT;
  cin >> s >> t;
  for (auto c = 0; c < 26; ++c) {
    vector<int> vs, vt;
    for (auto i = 0; i < lenS; ++i) {
      vs.push_back((s[i] - 'a') == c);
    }
    for (auto i = 0; i < lenT; ++i) {
      vt.push_back((t[i] - 'a') == c);
    }
    hashS[c] =
        make_pair(StringHasher<3, 1000001927>::getHash(vs.begin(), vs.end()),
                  StringHasher<5, 1000001963>::getHash(vs.begin(), vs.end()));
    hashT[c] =
        make_pair(StringHasher<3, 1000001927>::getHash(vt.begin(), vt.end()),
                  StringHasher<5, 1000001963>::getHash(vt.begin(), vt.end()));
  }
  for (auto c = 0; c < 26; ++c) {
    hT[c] =
        StringHasher<3, 1000001927>::getHashValue(hashT[c].first) * 1000001927 +
        StringHasher<5, 1000001963>::getHashValue(hashT[c].second);
  }
  htSorted = hT;
  sort(htSorted.begin(), htSorted.end());
  vector<int> ans;
  for (auto i = 0; i < lenS - lenT + 1; ++i) {
    if (check(i)) {
      ans.push_back(i);
    }
  }
  cout << ans.size() << endl;
  for (int i : ans) cout << (i + 1) << " ";
  return 0;
}
