#include <bits/stdc++.h>
using namespace std;
int n, m;
int main() {
  char w[500][500];
  int i, j;
  long long k, ans;
  while (scanf("%d%d\n", &n, &m) != EOF) {
    ans = 1;
    for (i = 0; i < n; i++) scanf("%s", w[i]);
    for (i = 0; i < m; i++) {
      bool u[100];
      memset(u, 0, sizeof(u));
      for (j = 0; j < n; j++)
        if (u[w[j][i]] == 0) u[int(w[j][i] - 'A')] = 1;
      k = 0;
      for (j = 0; j < 100; j++)
        if (u[j] == 1) k++;
      ans = ans * k % 1000000007;
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
