#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  int n, m;
  cin >> n >> m;
  string data[n];
  for (int i = 0; i < n; i++) cin >> data[i];
  set<char> current;
  uint64_t ret = 1;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      current.insert(data[j][i]);
    }
    ret = (current.size() * ret) % mod;
    current.clear();
  }
  cout << ret << "\n";
  return 0;
}
