#include <bits/stdc++.h>
const double pi = acos(-1);
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const int MAXN = 1e2 + 5;
const double eps = 1e-9;
using namespace std;
char tmp[MAXN];
int cnt[MAXN][30];
int main() {
  memset(cnt, 0, sizeof cnt);
  int n, m;
  scanf("%d", &n), scanf("%d", &m);
  for (int i = 0; i < n; i++) {
    scanf("%s", tmp);
    for (int j = 0; j < m; j++) cnt[j][tmp[j] - 'A'] = 1;
  }
  long long ans = 1ll;
  for (int i = 0; i < m; i++) {
    long long tmp = 0ll;
    for (int j = 0; j < 30; j++)
      if (cnt[i][j]) tmp++;
    ans = (ans * tmp) % MOD;
  }
  printf("%I64d\n", ans);
  return 0;
}
