#include <bits/stdc++.h>
using namespace std;
char a[100][100];
int alpha[26] = {0};
long long total = 1;
int b = 1e9 + 7;
int main() {
  int n, m, i = 0, j = 0, cnt = 0;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  for (j = 0; j < m; j++) {
    for (i = 0; i < n; i++) {
      if (alpha[a[i][j] - 65] == 0) {
        alpha[a[i][j] - 65] = 1;
      }
    }
    for (i = 0; i < 26; i++) {
      if (alpha[i] == 1) {
        cnt++;
      }
      alpha[i] = 0;
    }
    total = (total * cnt) % b;
    cnt = 0;
  }
  cout << total;
}
