#include <bits/stdc++.h>
using namespace std;
long long n, k, x, unlucky, ans, fact[100001], dp[1100][1100], mod = 1000000007;
vector<int> c;
map<int, int> m;
long long powlog(long long a, long long b) {
  if (b == 0) return 1;
  long long ret = powlog(a, b / 2);
  if (b % 2) return ret * ret % mod * a % mod;
  return ret * ret % mod;
}
bool lucky(int x) {
  while (x) {
    if (x % 10 != 4 && x % 10 != 7) return 0;
    x /= 10;
  }
  return 1;
}
long long C(long long n, long long r) {
  if (r > n || r < 0) return 0;
  return fact[n] * powlog(fact[r] * fact[n - r] % mod, mod - 2) % mod;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  fact[0] = 1;
  for (long long i = 1; i <= 100000; i++) fact[i] = fact[i - 1] * i % mod;
  cin >> n >> k;
  for (int i = 0; i < n && cin >> x; i++)
    if (lucky(x))
      m[x]++;
    else
      unlucky++;
  c.push_back(0);
  for (auto &i : m) c.push_back(i.second);
  dp[0][0] = 1;
  for (int i = 1; i < c.size(); i++)
    for (int j = 0; j <= i; j++)
      dp[i][j] =
          (dp[i - 1][j] + (j == 0 ? 0 : dp[i - 1][j - 1] * c[i]) % mod) % mod;
  for (int i = 0; i < c.size(); i++)
    ans = (ans + dp[c.size() - 1][i] * C(unlucky, k - i) % mod) % mod;
  cout << ans << endl;
  return 0;
}
