#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
signed main() {
  ios::sync_with_stdio(0);
  long long n, m;
  cin >> n >> m;
  string s[n];
  long long ans = 1;
  for (long long i = 0; i < n; i++) cin >> s[i];
  for (long long i = 0; i < m; i++) {
    long long c[26] = {}, s1 = 0;
    for (long long j = 0; j < n; j++) {
      c[s[j][i] - 'A']++;
    }
    for (long long j = 0; j < 26; j++) {
      if (c[j]) s1++;
    }
    ans = (ans * s1) % mod;
  }
  cout << ans;
  return 0;
}
