#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 5;
const int MOD = 1e9 + 7;
int n, k;
int fat[MAX], app[MAX], inv[MAX], inv_fat[MAX];
int dp[2][MAX];
inline int add(int a, int b) {
  a += b;
  if (a >= MOD) {
    a -= MOD;
  }
  return a;
}
inline int mult(int a, int b) { return (1LL * a * b) % MOD; }
inline int comb(int a, int b) {
  if (b > a) {
    return 0;
  }
  return mult(fat[a], mult(inv_fat[b], inv_fat[a - b]));
}
int main() {
  fat[0] = fat[1] = 1;
  inv[1] = inv_fat[0] = inv_fat[1] = 1;
  for (int i = int(2); i < int(MAX); i++) {
    fat[i] = mult(fat[i - 1], i);
    int q = MOD / i;
    int r = MOD % i;
    inv[i] = -mult(q, inv[r]);
    inv[i] += MOD;
    inv_fat[i] = mult(inv_fat[i - 1], inv[i]);
  }
  scanf("%d %d", &n, &k);
  map<int, int> mp;
  int luckies = 0;
  for (int i = int(1); i < int(n + 1); i++) {
    int cur;
    scanf("%d", &cur);
    int _ = cur;
    bool lucky = true;
    while (cur) {
      if ((cur % 10) != 4 && (cur % 10) != 7) {
        lucky = false;
      }
      cur /= 10;
    }
    if (lucky) {
      mp[_]++;
      luckies++;
    }
  }
  vector<int> v;
  for (auto &each : mp) {
    v.push_back(each.second);
  }
  dp[0][0] = 1;
  if (!v.empty()) {
    dp[0][1] = v[0];
  }
  for (int i = int(1); i < int(v.size()); i++) {
    int now = i & 1;
    int prev = 1 - (i & 1);
    dp[now][0] = dp[prev][0];
    for (int j = int(1); j < int(k + 1); j++) {
      dp[now][j] = mult(dp[prev][j - 1], v[i]);
      dp[now][j] = add(dp[now][j], dp[prev][j]);
    }
  }
  int rest = n - luckies;
  int size = v.empty() ? 0 : v.size() - 1;
  int ans = 0;
  for (int i = int(0); i < int(k + 1); i++) {
    int cur = mult(dp[size & 1][i], comb(rest, k - i));
    ans = add(ans, cur);
  }
  printf("%d\n", ans);
  return 0;
}
