#include <bits/stdc++.h>
int hash[105][27] = {0};
long long int ans[105] = {0};
int main() {
  int n, m;
  char str[105];
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%s", str);
    for (int j = 0; j < m; j++) {
      if (hash[j][str[j] - 'A'] == 0) {
        hash[j][str[j] - 'A'] = 1;
        ans[j]++;
      }
    }
  }
  long long int a = 1;
  for (int j = 0; j < m; j++) {
    a = ((a % 1000000007) * (ans[j] % 1000000007)) % 1000000007;
  }
  printf("%lld\n", a);
  return 0;
}
