#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
bool mas[333];
char s[111][111];
int main() {
  int n, m, sum, i, x;
  char c;
  long long int ans = 1;
  scanf("%d%d\n", &n, &m);
  for (i = 0; i < n; i++) gets(s[i]);
  for (x = 0; x < m; x++) {
    sum = 0;
    memset(mas, false, sizeof mas);
    for (i = 0; i < n; i++) mas[s[i][x]] = true;
    for (c = 'A'; c <= 'Z'; c++)
      if (mas[c]) sum++;
    ans = (ans * sum) % mod;
  }
  cout << ans << endl;
  return 0;
}
