#include <bits/stdc++.h>
static const long long LLMAX = 0x7fffffffffffffffLL;
static const int IMAX = 0x7fffffff;
using namespace std;
int oCnt;
long long l[100010];
int lCnt;
long long m[100010];
int mCnt;
long long md = 1000000007LL;
long long dp[100010];
long long fact[100010];
template <class T>
T modqpow(T a, T n, T m) {
  T x = a;
  T y = (n & 1) ? a : 1;
  T np = (n >> 1);
  while (np > 0) {
    x = x * x % m;
    if (np & 1) y = y == 1 ? x : y * x % m;
    np = (np >> 1);
  }
  return y;
}
template <class T>
T modc(T n, T m, T p) {
  if (m < 0 || m > n) return (T)0;
  return ((fact[n] * modqpow(fact[n - m], p - 2, p)) % p) *
         (modqpow(fact[m], p - 2, p)) % p;
}
template <class T>
T Lucas(T n, T m, T p) {
  if (m == 0) return (T)1;
  return (Lucas(n / p, m / p, p) * modc(n % p, m % p, p)) % p;
}
bool isLucky(long long number) {
  while (number) {
    long long m = number % 10;
    if (m != 4 && m != 7) {
      return false;
    }
    number /= 10;
  }
  return true;
}
int main() {
  fact[0] = 1LL;
  for (int i = 0; i < 100009; ++i) {
    fact[i + 1] = (fact[i] * (i + 1LL) % md) % md;
  }
  int n, k;
  while (~scanf("%d%d", &n, &k)) {
    oCnt = 0;
    lCnt = 0;
    for (int i = 0; i < n; ++i) {
      long long v;
      scanf("%I64d", &v);
      if (isLucky(v)) {
        l[lCnt++] = v;
      } else {
        oCnt++;
      }
    }
    mCnt = 0;
    if (lCnt != 0) {
      sort(l, l + lCnt);
      long long last = l[0];
      m[mCnt] = 1;
      for (int i = 1; i < lCnt; ++i) {
        if (l[i] == last) {
          m[mCnt]++;
        } else {
          mCnt++;
          last = l[i];
          m[mCnt] = 1;
        }
      }
      mCnt++;
    }
    dp[0] = 1LL;
    for (int i = 0; i < mCnt; ++i) {
      for (int j = i; j >= 0; --j) {
        dp[j + 1] += (dp[j] % md) * (m[i] % md);
        dp[j + 1] %= md;
      }
    }
    long long ans = 0LL;
    for (int i = 0; i < k + 1; ++i) {
      ans += Lucas((long long)oCnt, (long long)k - i, md) * dp[i] % md;
      ans %= md;
    }
    printf("%I64d\n", ans);
  }
  return 0;
}
