#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<string> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  long long sol = 1;
  for (int i = 0; i < m; i++) {
    vector<bool> freq(26, false);
    for (int j = 0; j < n; j++) {
      freq[v[j][i] - 'A'] = true;
    }
    long long k = 0;
    for (int j = 0; j < 26; j++) {
      k += freq[j];
    }
    sol *= k;
    sol %= 1000000007;
  }
  cout << sol;
  return 0;
}
