#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<string> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int ans = 1;
  for (int i = 0; i < m; i++) {
    vector<int> c(26, 0);
    for (int j = 0; j < n; j++) c[a[j][i] - 'A'] = 1;
    int cnt = 0;
    for (int j = 0; j < 26; j++) cnt += c[j];
    ans = 1ll * ans * cnt % mod;
  }
  cout << ans << endl;
}
