#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream &printContainer(ostream &o, const T &c) {
  for (auto it = (c).begin(); it != (c).end(); it++) {
    o << *it << ' ';
  }
  return o;
}
template <class T>
ostream &operator<<(ostream &o, const vector<T> &c) {
  return printContainer(o, c);
}
template <class T>
ostream &operator<<(ostream &o, const deque<T> &c) {
  return printContainer(o, c);
}
template <class T>
ostream &operator<<(ostream &o, const list<T> &c) {
  return printContainer(o, c);
}
template <class T>
ostream &operator<<(ostream &o, const set<T> &c) {
  return printContainer(o, c);
}
template <class T>
ostream &operator<<(ostream &o, const unordered_set<T> &c) {
  return printContainer(o, c);
}
template <class T>
ostream &operator<<(ostream &o, const multiset<T> &c) {
  return printContainer(o, c);
}
template <class T, class V>
ostream &operator<<(ostream &o, const map<T, V> &c) {
  return printContainer(o, c);
}
template <class T, class V>
ostream &operator<<(ostream &o, const unordered_map<T, V> &c) {
  return printContainer(o, c);
}
template <class T, class V>
ostream &operator<<(ostream &o, const pair<T, V> &c) {
  return (o << "(" << c.ft << "," << c.second << ")");
}
const long long MOD = 1000000007;
const long long INF = (long long)MOD * MOD;
const long longMAXN = 1e5 + 100;
vector<int> spe, arr;
long long fact[100005];
void pre() {
  fact[0] = 1;
  for (long long i = 1; i < 100005; i++) {
    fact[i] = (fact[i - 1] * i) % MOD;
  }
}
long long powermod(long long _a, long long _b, long long _m) {
  long long _r = 1;
  while (_b) {
    if (_b % 2 == 1) _r = (_r * _a) % _m;
    _b /= 2;
    _a = (_a * _a) % _m;
  }
  return _r;
}
long long ncr(long long n, long long r) {
  if (n < r) return 0;
  long long tmp = fact[n];
  long long tmp1 = fact[r];
  tmp1 = (tmp1 * fact[n - r]) % MOD;
  tmp1 = powermod(tmp1, MOD - 2, MOD);
  tmp = (tmp * tmp1) % MOD;
  return tmp;
}
bool isspecial(long long s) {
  while (s) {
    long long x = s % 10;
    if ((x != 7) && (x != 4)) return false;
    s /= 10;
  }
  return true;
}
map<int, int> cnt;
long long dp[2000][2000];
int main() {
  pre();
  long long n, k;
  cin >> n >> k;
  arr.resize(n);
  long long total = 0;
  cnt.clear();
  for (long long i = 0; i < n; i++) {
    cin >> arr[i];
    if (isspecial(arr[i])) {
      cnt[arr[i]]++;
      total++;
    }
  }
  for (auto it : cnt) spe.push_back(it.second);
  long long pp = cnt.size();
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  long long top = min(k, pp);
  for (long long i = 0; i < pp; i++) {
    for (long long j = 0; j <= top; j++) {
      dp[i + 1][j] += dp[i][j];
      if ((j + 1) <= top) dp[i + 1][j + 1] += dp[i][j] * 1LL * spe[i];
      dp[i + 1][j] %= MOD;
      dp[i + 1][j + 1] %= MOD;
    }
  }
  long long ans = 0;
  long long rem = n - total;
  for (long long i = 0; i <= top; i++) {
    assert(rem >= 0);
    assert(k >= i);
    ans += dp[pp][i] * 1LL * ncr(rem, k - i);
    ans %= MOD;
  }
  cout << ans;
}
