#include <bits/stdc++.h>
using namespace std;
const int M = 1e5 + 7;
long long int v[M], ar[M], ans[M], bns[M], out[M], f[M], inv[M];
map<long long int, long long int> mp;
long long int pwr(long long int a, long long int n, long long int m) {
  long long int p = 1;
  while (n > 0) {
    if (n % 2 == 1) p = (p * a) % m;
    a = (a * a) % m;
    n = n / 2;
  }
  return p;
}
long long int ncr(long long int p, long long int q) {
  if (p < q) return 0;
  if (p == q || q == 0) return 1;
  return (((f[p] * inv[q]) % (long long int)(1e9 + 7)) * inv[p - q]) %
         (long long int)(1e9 + 7);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, k, h = 1, i, t, p, fl, non = 0, dis = 0, j;
  cin >> n >> k;
  f[0] = 1;
  inv[0] = 1;
  for (i = 1; i <= n; ++i) {
    f[i] = (f[i - 1] * i) % (long long int)(1e9 + 7);
    inv[i] = pwr(f[i], (long long int)(1e9 + 7) - 2, (long long int)(1e9 + 7));
  }
  for (i = 1; i <= n; ++i) {
    cin >> v[i];
    t = v[i];
    fl = 0;
    while (t > 0) {
      if ((t % 10) != 7 && (t % 10) != 4) fl = 1;
      t = t / 10;
    }
    if (fl)
      non++;
    else {
      if (mp[v[i]] == 0) {
        mp[v[i]] = h++;
        ar[mp[v[i]]]++;
      } else
        ar[mp[v[i]]]++;
    }
  }
  h--;
  for (i = 1; i <= h + 1; ++i) bns[i] = 1;
  for (j = 1; j <= h; ++j) {
    for (i = h + 1 - j; i > 0; i--) {
      p = (ar[i] * bns[i + 1]) % (long long int)(1e9 + 7);
      ans[i] = (ans[i + 1] + p) % (long long int)(1e9 + 7);
      out[j] = (out[j] + p) % (long long int)(1e9 + 7);
    }
    bns[h + 1] = 0;
    for (i = h + 1 - j; i > 0; i--) {
      bns[i] = ans[i];
      ans[i] = 0;
    }
  }
  out[0] = 1;
  for (i = k; i >= 0; i--) {
    dis = (dis + ((ncr(non, i) * out[k - i]) % (long long int)(1e9 + 7))) %
          (long long int)(1e9 + 7);
  }
  cout << dis << "\n";
  return 0;
}
