#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  while (cin >> n >> m) {
    vector<set<char>> V;
    V.resize(m);
    long long counter = 1;
    for (int i = 0; i < n; i++) {
      string s;
      cin >> s;
      for (int j = 0; j < m; j++) {
        V[j].insert(s[j]);
      }
    }
    for (int j = 0; j < m; j++) {
      counter = (counter * V[j].size()) % 1000000007;
    }
    cout << counter % 1000000007 << endl;
  }
}
