#include <bits/stdc++.h>
using namespace std;
int n, m, b[1005], c[105];
char a[105][105];
long long sum;
int main() {
  sum = 1;
  memset(b, 0, sizeof(b));
  memset(c, 0, sizeof(c));
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", a[i]);
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++)
      if (b[a[j][i]] == 0) {
        b[a[j][i]]++;
        c[i]++;
      }
    memset(b, 0, sizeof(b));
  }
  for (int i = 0; i < m; i++) sum = (sum * c[i]) % 1000000007;
  printf("%lld", sum);
}
