#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 24;
const long long inf = 1e9 + 7;
long long n, k, flag = 0;
map<long long, long long> m;
vector<long long> v;
long long dp[2][N], f[N];
inline long long fpow(long long n, long long k, long long p = inf) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
inline long long inv(long long a, long long p = inf) {
  return fpow(a, p - 2, p);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long i, j, first, second, a, b, ans = 0, k;
  cin >> n >> k;
  f[0] = 1;
  long long t = n;
  for (i = 1; i <= 1e5; i++) f[i] = f[i - 1] * i % inf;
  for (i = 1; i <= n; i++) {
    cin >> a;
    m[a] += 1;
  }
  v.push_back(0);
  a = 0;
  for (j = 0; j < 9; j++) {
    b = v.size();
    for (i = a; i < b; i++) {
      v.push_back(v[i] * 10 + 4), v.push_back(v[i] * 10 + 7);
    }
    a = b;
  }
  sort(v.begin(), v.end());
  n = v.size() - 1;
  a = 0;
  for (auto it : m) {
    if ((*lower_bound(v.begin(), v.end(), it.first)) == it.first)
      a += it.second;
  }
  dp[0][0] = 1;
  for (i = 1; i <= n; i++) {
    dp[i & 1][0] = 1;
    for (j = 1; j <= i; j++)
      dp[i & 1][j] =
          (dp[(i - 1) & 1][j] + dp[(i - 1) & 1][j - 1] * m[v[i]]) % inf;
  }
  for (i = 0; i <= k; i++)
    if (t - a >= i)
      ans = (ans + dp[n & 1][k - i] * f[t - a] % inf * inv(f[t - a - i]) % inf *
                       inv(f[i]) % inf) %
            inf;
  cout << ans;
}
