#include <bits/stdc++.h>
using namespace std;
const int INF = (1 << 30) - 1;
const long long LINF = (1ll << 62) - 1;
const int DIRX[] = {-1, 0, 0, 1, -1, -1, 1, 1},
          DIRY[] = {0, -1, 1, 0, -1, 1, -1, 1};
const double ERR = 1e-11, PI = (2 * acos(0.0));
template <class T>
inline T MIN(T a, T b) {
  return ((a < b) ? (a) : (b));
}
template <class T>
inline T MAX(T a, T b) {
  return ((b < a) ? (a) : (b));
}
template <class T>
inline T ABS(T a) {
  return ((a < 0) ? (-a) : (a));
}
template <class T>
inline void checkMIN(T& a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void checkMAX(T& a, T b) {
  if (a < b) a = b;
}
template <class T>
inline T SQR(T x) {
  return (x * x);
}
template <class T>
T GCD(T a, T b) {
  return ((!b) ? (a) : GCD(b, a % b));
}
template <class T>
T fastPow(T Base, T Power) {
  T Result = 1;
  while (Power > 0) {
    if (Power & ((T)1)) Result *= Base;
    Power >>= 1;
    Base *= Base;
  }
  return Result;
}
template <class T>
T fastModPow(T Base, T Power, T Mod) {
  T Result = 1;
  while (Power > 0) {
    if (Power & ((T)1)) Result = (Result * Base) % Mod;
    Power >>= 1;
    Base = (Base * Base) % Mod;
  }
  return (Result % Mod);
}
inline int compDouble(double x, double y) {
  double d = x - y;
  if (d - ERR > 0.0)
    return 1;
  else if (d + ERR < 0.0)
    return -1;
  else
    return 0;
}
const long long mod = 1000000007;
long long fac[100005];
bool isLucky(int n) {
  while (n) {
    if (n % 10 != 4 && n % 10 != 7) return false;
    n /= 10;
  }
  return true;
}
map<int, int> mp;
long long ncr(long long n, long long r) {
  if (n < r) return 0;
  long long c = fac[n];
  c = (c * fastModPow(fac[r], mod - 2, mod)) % mod;
  c = (c * fastModPow(fac[n - r], mod - 2, mod)) % mod;
  return c;
}
vector<int> f;
long long dp[1024][1024];
int main() {
  int i, j, k, n;
  int a = 0, b = 0;
  cin >> n >> k;
  fac[0] = 1;
  for (i = (1); i <= (n); i++) fac[i] = (i * fac[i - 1]) % mod;
  for (i = 0; i < (int)(n); i++) {
    cin >> j;
    if (isLucky(j))
      mp[j]++;
    else
      b++;
  }
  for (__typeof((mp).begin()) it = (mp).begin(); it != (mp).end(); it++)
    f.push_back(it->second);
  a = ((int)(f).size());
  dp[0][0] = 1;
  for (i = (1); i <= (a); i++) {
    dp[i][0] = 1;
    for (j = (1); j <= (i); j++)
      dp[i][j] = (dp[i - 1][j - 1] * f[i - 1] + dp[i - 1][j]) % mod;
  }
  long long r = 0;
  for (i = (0); i <= (((a) < (k) ? (a) : (k))); i++) {
    r = (r + (dp[a][i] * ncr(b, k - i)) % mod) % mod;
  }
  cout << r << endl;
  return 0;
}
