#include <bits/stdc++.h>
using namespace std;
int dp[1100 + 1][1100 + 1];
map<int, int> luck;
map<int, int>::iterator it;
int pow(int a, int b) {
  if (b == 0) return 1;
  if (b & 1) return (pow(a, b - 1) * 1LL * a) % 1000000007;
  int izraz = pow(a, b >> 1);
  return (izraz * 1LL * izraz) % 1000000007;
}
int inverz(int x) { return pow(x, 1000000007 - 2); }
int c(int n, int k) {
  int ret = 1;
  if (n - k < k) k = n - k;
  for (int i = n - k + 1; i <= n; ++i) {
    ret = (ret * 1LL * i) % 1000000007;
  }
  for (int i = 1; i <= k; ++i) {
    ret = (ret * 1LL * inverz(i)) % 1000000007;
  }
  return ret;
}
bool lucky(int x) {
  while (x) {
    if (x % 10 != 7 && x % 10 != 4) return 0;
    x /= 10;
  }
  return 1;
}
int main(void) {
  int n, k, x, ostali = 0;
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &x);
    if (lucky(x))
      luck[x]++;
    else
      ostali++;
  }
  int pos = 0, taken = 0;
  dp[0][0] = 1;
  for (it = luck.begin(); it != luck.end(); ++it) {
    for (int j = 0; j <= pos; ++j) {
      dp[pos + 1][j] = (dp[pos + 1][j] + dp[pos][j]) % 1000000007;
      dp[pos + 1][j + 1] =
          (dp[pos + 1][j + 1] + dp[pos][j] * 1LL * it->second) % 1000000007;
    }
    ++pos;
  }
  int ans = 0;
  int coef = c(ostali, k);
  for (int i = max(0, k - ostali); i <= k && i <= pos; ++i) {
    ans = (ans + coef * 1LL * dp[pos][i] % 1000000007) % 1000000007;
    coef = (coef * 1LL * inverz(ostali - k + i + 1) % 1000000007) * (k - i) %
           1000000007;
  }
  cout << ans << endl;
}
