#include <bits/stdc++.h>
const int MAXN = 200001;
const int inf = 0x3f3f3f3f;
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  string mz[n];
  for (int i = 0; i < n; i++) cin >> mz[i];
  long long int sum = 1;
  bool c[26] = {false};
  for (long long int i = 0; i < m; i++) {
    long long int counts = 0;
    for (long long int j = 0; j < n; j++) {
      c[mz[j][i] - 'A'] = true;
    }
    for (int k = 0; k < 26; k++)
      if (c[k]) c[k] = false, counts++;
    sum *= (counts % 1000000007), sum %= 1000000007;
  }
  cout << sum;
  return 0;
}
