#include <bits/stdc++.h>
using namespace std;
bool used[30];
string names[100];
int main() {
  int n, m;
  long long ans = 1;
  int mod = 1000000007;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) cin >> names[i];
  for (int i = 0; i < m; ++i) {
    fill(used, used + 30, false);
    for (int j = 0; j < n; ++j) {
      used[names[j][i] - 'A'] = true;
    }
    int count = 0;
    for (int j = 0; j < 30; ++j) {
      count += used[j];
    }
    ans = (ans * count) % mod;
  }
  cout << ans << endl;
  return 0;
}
