#include <bits/stdc++.h>
using namespace std;
int main() {
  const int N = 2005;
  const int mod = 1e9 + 7;
  ios::sync_with_stdio(0);
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int n, m;
  cin >> n >> m;
  char a[200][200];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int v;
  int sum = 0;
  int t[105];
  for (int i = 0; i < m; i++) {
    int freq[200] = {0};
    sum = 0;
    for (int j = 0; j < n; j++) {
      v = a[j][i] - 'A';
      freq[v]++;
    }
    for (int i = 0; i < 26; i++) {
      if (freq[i] >= 1) {
        sum++;
      }
    }
    t[i] = sum;
  }
  long long ans = 1;
  for (int i = 0; i < m; i++) {
    ans = (ans * t[i]) % mod;
  }
  cout << ans;
}
