#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<map<char, int> > positions(m);
  while (n-- > 0) {
    string name;
    cin >> name;
    for (int i = 0; i < m; i++) {
      positions[i][name[i]] = 1;
    }
  }
  long long options = 1;
  for (vector<map<char, int> >::iterator it = positions.begin();
       it != positions.end(); it++) {
    options = (options * (*it).size()) % 1000000007;
  }
  cout << endl << options << endl;
  return 0;
}
