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