#include <bits/stdc++.h>
using namespace std;
long long n, l, r, x, maxi, c, m, out, mod;
long long cnt[150];
char arr[111][111], f;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  out++;
  mod = 1e9;
  mod += 7;
  f = 'A';
  cin >> n >> m;
  for (long long i = 0; i <= n - 1; i++) {
    for (long long j = 0; j <= m - 1; j++) {
      cin >> arr[i][j];
    }
  }
  for (long long j = 0; j <= m - 1; j++) {
    for (long long i = 0; i <= n - 1; i++) {
      cnt[arr[i][j] - 'A']++;
    }
    c = 0;
    for (long long i = 0; i <= 25; i++) {
      if (cnt[i]) c++;
      cnt[i] = 0;
    }
    out *= c, out %= mod;
  }
  cout << out << endl;
  cin >> n;
  return 0;
}
