#include <bits/stdc++.h>
using namespace std;
vector<string> arr;
long long mod = 1000000007;
int main() {
  int n, m;
  cin >> n >> m;
  arr.resize(n);
  vector<long long> freq;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  freq.resize(m);
  for (int j = 0; j < m; j++) {
    vector<bool> chars;
    chars.resize(26);
    for (int i = 0; i < n; i++) {
      chars[arr[i][j] - 'A'] = 1;
    }
    for (int i = 0; i < 26; i++) {
      freq[j] += chars[i];
    }
  }
  long long ans = 1;
  for (int i = 0; i < m; i++) {
    ans *= freq[i];
    ans = ans % mod;
  }
  cout << ans;
}
