#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  string ar[100];
  for (int i = 0; i < n; ++i) cin >> ar[i];
  int c[100] = {
      0,
  };
  long long int ret = 1;
  for (int i = 0; i < m; ++i) {
    bool al[26] = {false};
    for (int j = 0; j < n; ++j) {
      if (!al[ar[j][i] - 'A']) ++c[i];
      al[ar[j][i] - 'A'] = true;
    }
    ret = (ret * c[i]) % mod;
  }
  cout << ret << endl;
}
