#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
long long v[500000];
long long f[100005], p[100005];
long long bmod(long long a, long long b) {
  if (b == 0) return 1;
  long long r;
  r = bmod(a, b / 2);
  if (b % 2 == 1) return (((r * r) % 1000000007) * a) % 1000000007;
  return (r * r) % 1000000007;
}
long long C(int n, int m) {
  if (n < m) return 0;
  long long ret;
  ret = p[n];
  ret = (ret * bmod(p[m], 1000000007 - 2)) % 1000000007;
  ret = (ret * bmod(p[n - m], 1000000007 - 2)) % 1000000007;
  return ret;
}
bool chk(int n) {
  while (n) {
    int t = n % 10;
    if (t == 4 || t == 7) {
      n /= 10;
    } else
      return false;
  }
  return true;
}
int main() {
  int n, k;
  int i, j;
  scanf("%d%d", &n, &k);
  int m = 0;
  for (i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    if (chk(x))
      mp[x]++;
    else
      m++;
  }
  map<int, int>::iterator it;
  int cnt = 0;
  for (it = mp.begin(); it != mp.end(); it++) {
    v[cnt++] = it->second;
  }
  memset(f, 0, sizeof(f));
  f[0] = 1;
  for (i = 0; i < cnt; i++) {
    for (j = k; j - 1 >= 0; j--) {
      f[j] = (f[j] + f[j - 1] * v[i]) % 1000000007;
    }
  }
  long long ans = 0;
  p[0] = 1;
  for (i = 1; i <= n; i++) {
    p[i] = (p[i - 1] * i) % 1000000007;
  }
  for (i = 0; i <= k && i <= m; i++) {
    ans = (ans + f[k - i] * C(m, i)) % 1000000007;
  }
  printf("%I64d\n", ans);
  return 0;
}
