#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long INFL = LLONG_MAX;
const int MOD = 1e9 + 7;
int N, M;
string s[100];
long long ans = 1;
int main() {
  ios_base::sync_with_stdio(0);
  cout.precision(15);
  cin >> N >> M;
  for (int(i) = 0; (i) < (N); (i)++) cin >> s[i];
  for (int(i) = 0; (i) < (M); (i)++) {
    set<char> chs;
    for (int(ii) = 0; (ii) < (N); (ii)++) chs.insert(s[ii][i]);
    ans = (ans * chs.size()) % MOD;
  }
  cout << ans << '\n';
}
