#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<set<char> > v(m);
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    for (int j = 0; j < m; j++) v[j].insert(s[j]);
  }
  long long out = 1;
  for (int i = 0; i < m; i++) {
    out = (out * v[i].size()) % 1000000007;
  }
  cout << out % 10000000007 << endl;
}
