#include <bits/stdc++.h>
using namespace std;
const int Mod = 1e9 + 7;
int n, m;
long long cont = 0;
char s[105][105];
int num[30];
long long ans = 1;
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) scanf(" %c", &s[i][j]);
  for (int j = 1; j <= m; j++) {
    cont = 0;
    memset(num, 0, sizeof(num));
    for (int i = 1; i <= n; i++)
      if (!num[s[i][j] - 'A']) {
        cont++;
        num[s[i][j] - 'A'] = 1;
      }
    ans = (ans * cont % Mod) % Mod;
  }
  printf("%lld\n", ans);
  return 0;
}
