#include <bits/stdc++.h>
using namespace std;
int main() {
  int m, n;
  cin >> n >> m;
  bool ex[m][26];
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < 26; j++) ex[i][j] = false;
  }
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    for (int j = 0; j < m; j++) {
      ex[j][int(s[j] - 'A')] = true;
    }
  }
  long long answ = 1, t;
  for (int i = 0; i < m; i++) {
    t = 0;
    for (int j = 0; j < 26; j++) {
      if (ex[i][j]) t++;
    }
    answ *= (t);
    answ %= 1000000007;
  }
  cout << answ;
  return 0;
}
