#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m;
  cin >> n >> m;
  char arr[n][m];
  long long int ans = 1;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) cin >> arr[i][j];
  }
  for (long long int i = 0; i < m; i++) {
    long long int a[26] = {0};
    for (long long int j = 0; j < n; j++) {
      a[arr[j][i] - 'A']++;
    }
    long long int count = 0;
    for (long long int i = 0; i < 26; i++) {
      if (a[i] > 0) count++;
    }
    ans = (ans * count) % 1000000007;
  }
  cout << ans;
  return 0;
}
