#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  vector<string> x;
  cin >> n >> m;
  int arr[101][26] = {0};
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    x.push_back(s);
    for (int j = 0; j < s.size(); j++) {
      arr[j][s[j] - 'A'] = 1;
    }
  }
  unsigned long long res = 1;
  for (int i = 0; i < m; i++) {
    long long count = 0;
    for (int j = 0; j < 26; j++) {
      count += arr[i][j];
    }
    res = res * count;
    res %= (1000000007);
  }
  res = res % (1000000007);
  cout << res;
}
