#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  long long int result = 1, Mod = 1000000007;
  char temp;
  cin >> n >> m;
  vector<set<char> > arr(m);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) cin >> temp, arr[j].insert(temp);
  for (int i = 0; i < m; i++) result *= arr[i].size(), result %= Mod;
  cout << result << endl;
  return 0;
}
