#include <bits/stdc++.h>
using namespace std;
vector<int> A(110, 1);
char a[110][110];
int main() {
  int n, m;
  cin >> n >> m;
  for (int(i) = (0); (i) < (n); (i)++)
    for (int(j) = (0); (j) < (m); (j)++) cin >> a[i][j];
  for (int(j) = (0); (j) < (m); (j)++) {
    set<char> s;
    for (int(i) = (0); (i) < (n); (i)++) s.insert(a[i][j]);
    int first = (int)s.size();
    A[j] = max(A[j], first);
  }
  long long ans = 1;
  for (int(i) = (0); (i) < (m); (i)++) {
    ans *= (long long)A[i];
    ans %= (long long)1000000007;
  }
  cout << ans << '\n';
  return 0;
}
