One day little Vasya found mom's pocket book. The book had n names of her friends and unusually enough, each name was exactly m letters long. Let's number the names from 1 to n in the order in which they are written.

As mom wasn't home, Vasya decided to play with names: he chose three integers i, j, k (1 ≤ i < j ≤ n, 1 ≤ k ≤ m), then he took names number i and j and swapped their prefixes of length k. For example, if we take names "CBDAD" and "AABRD" and swap their prefixes with the length of 3, the result will be names "AABAD" and "CBDRD".

You wonder how many different names Vasya can write instead of name number 1, if Vasya is allowed to perform any number of the described actions. As Vasya performs each action, he chooses numbers i, j, k independently from the previous moves and his choice is based entirely on his will. The sought number can be very large, so you should only find it modulo 1000000007 (109 + 7).

Input

The first input line contains two integers n and m (1 ≤ n, m ≤ 100) — the number of names and the length of each name, correspondingly. Then n lines contain names, each name consists of exactly m uppercase Latin letters.

Output

Print the single number — the number of different names that could end up in position number 1 in the pocket book after the applying the procedures described above. Print the number modulo 1000000007 (109 + 7).

Examples

Input

2 3
AAB
BAA


Output

4


Input

4 5
ABABA
BCGDG
AAAAA
YABSA


Output

216

Note

In the first sample Vasya can get the following names in the position number 1: "AAB", "AAA", "BAA" and "BAB".
#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return (a / gcd(a, b)) * b;
}
int min3(int a, int b, int c) {
  if (a < b) {
    if (a < c)
      return a;
    else
      return c;
  } else {
    if (b < c)
      return b;
    else
      return c;
  }
}
int max3(int a, int b, int c) {
  if (a > b) {
    if (a > c)
      return a;
    else
      return c;
  } else {
    if (b > c)
      return b;
    else
      return c;
  }
}
long long int no_of_div(long long int n) {
  int cnt = 0;
  for (long long int i = 1; i <= (long long int)sqrt(n); i++) {
    if (n % i == 0) {
      cnt += 2;
      if (i * i == n) cnt--;
    }
  }
  return cnt;
}
vector<bool> is_prime(10000000, true);
vector<long long int> prime;
void sieve() {
  long long int n = 10000000;
  is_prime[0] = is_prime[1] = false;
  for (long long int i = 2; i <= n; i++) {
    if (is_prime[i]) prime.push_back(i);
    if (is_prime[i] && i * i <= n) {
      for (long long int j = i * i; j <= n; j += i) is_prime[j] = false;
    }
  }
}
long long int spf[15000001];
void spf_sieve() {
  long long int n = 15000001;
  memset(spf, -1, sizeof(spf));
  spf[0] = spf[1] = 0;
  bool arr[15000001];
  memset(arr, 1, sizeof(arr));
  for (long long int i = 2; i * i <= n; i++) {
    if (arr[i]) {
      for (long long int j = i; j * i <= n; j++) {
        spf[i * j] = i;
        arr[i * j] = 0;
      }
    }
  }
}
int prime_n[10000000];
void prime_till_N() {
  prime_n[0] = prime_n[1] = 0;
  int cnt = 0;
  for (int i = 0; i < 10000000; i++) {
    if (is_prime[i]) {
      prime_n[i] = ++cnt;
    } else
      prime_n[i] = cnt;
  }
}
long long int pascal[31][31];
void pascal_tri() {
  pascal[0][0] = 1;
  for (long long int i = 1; i <= 30; i++) {
    for (long long int j = 0; j <= 30; j++) {
      if (j == 0 || j == i)
        pascal[i][j] = 1;
      else
        pascal[i][j] = pascal[i - 1][j] + pascal[i - 1][j - 1];
    }
  }
}
long long int binomial_coeff(long long int n, long long int k) {
  if (k > n || n < 0 || k < 0) return 0;
  if (k > n - k) k = n - k;
  long long int ans = 1;
  for (int i = 0; i < k; i++) {
    ans += (n - i);
    ans /= (i + 1);
  }
  return ans;
}
long long int div_sum[1000000];
void divsum_sieve() {
  const long long int n = 500000 + 5;
  div_sum[1] = -1;
  for (long long int i = 2; i <= n; i++) {
    for (long long int j = i * 2; j <= n; j += i) {
      div_sum[j] += i;
    }
  }
}
void fun(vector<int>& arr, vector<vector<int> >& res, vector<int>& subset,
         int cur) {
  res.push_back(subset);
  for (int i = cur; i < arr.size(); i++) {
    subset.push_back(arr[i]);
    fun(arr, res, subset, i + 1);
    subset.pop_back();
  }
  return;
}
vector<int> subsetSums(vector<int> arr, int N) {
  int cur = 0;
  vector<vector<int> > res;
  vector<int> subset;
  fun(arr, res, subset, cur);
  vector<int> ans;
  for (int i = 0; i < res.size(); i++) {
    int sum = 0;
    if (res.empty()) {
      ans.push_back(sum);
      continue;
    }
    for (auto x : res[i]) {
      sum += x;
    }
    ans.push_back(sum);
  }
  return ans;
}
bool isgood(string str) {
  int x = 0, y = 0;
  for (int i = 0; i < str.size(); i++) {
    if (str[i] == '1')
      x++;
    else
      y++;
    if (x > 0 && str[i] == '0') return false;
  }
  return true;
}
long long int findroot(long long int n) {
  long long int l = 0, r = 1e9;
  long long int ans = 1;
  while (l <= r) {
    long long int mid = l + (r - l) / 2;
    if (mid * mid <= n) {
      ans = mid;
      l = mid + 1;
    } else {
      r = mid - 1;
    }
  }
  return ans;
}
long long int find_power(long long int a, long long int n) {
  long long int res = 1;
  while (n > 0) {
    if (n & 1) {
      res *= a;
      n--;
    } else {
      a *= a;
      n /= 2;
    }
  }
  return res;
}
long long int catlan[10005];
void find_cat() {
  catlan[0] = 1;
  catlan[1] = 1;
  for (int i = 2; i < 1005; i++) {
    catlan[i] = 0;
    for (int j = 0; j < i; j++) {
      catlan[i] += catlan[j] * catlan[i - 1 - j];
    }
  }
}
bool cmp(pair<long long int, long long int> a,
         pair<long long int, long long int> b) {
  return a.first < b.first || (a.first == b.first && (a.second < b.second));
}
void solve() {
  long long int n, m;
  cin >> n >> m;
  vector<string> str;
  string s;
  for (long long int i = 0; i < n; i++) {
    cin >> s;
    str.push_back(s);
  }
  long long int ans = 1;
  for (long long int i = 0; i < m; i++) {
    long long int cnt = 0;
    set<char> check;
    for (long long int j = 0; j < n; j++) {
      check.insert(str[j][i]);
    }
    ans = (ans * (check.size())) % 1000000007;
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
