#include <bits/stdc++.h>
using namespace std;
const int oo = 2000000009;
const double eps = 1e-9;
const int mod = 1000000007;
int cnt[102][256];
int main() {
  char str[102];
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < (n); ++i) {
    scanf("%s", str);
    for (int j = 0; j < (m); ++j) cnt[j][str[j]] = 1;
  }
  int ans = 1;
  for (int j = 0; j < (m); ++j) {
    int c = 0;
    for (int ch = 'A'; ch <= ('Z'); ++ch) c += cnt[j][ch];
    ans = (long long)c * ans % mod;
  }
  printf("%d", ans);
  return 0;
}
