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