#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  string a[n];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  long long int cnt = 1;
  for (long long int i = 0; i < m; i++) {
    long long int freq[26];
    memset(freq, 0, sizeof freq);
    for (long long int j = 0; j < n; j++) {
      freq[a[j][i] - 'A']++;
    }
    long long int c = 0;
    for (long long int j = 0; j < 26; j++) {
      if (freq[j]) c++;
    }
    cnt = (cnt * c) % 1000000007;
  }
  cout << cnt << endl;
  return 0;
}
