#include <bits/stdc++.h>   using namespace std;   const long long P = (long long)1e9 + 7;   int n, k;   int a[2];   long long c[60][60];   long long cnt[60][60];   int dp[60][60];   struct rmdr {     int i, j;     bool operator<(const rmdr& a) const {       if (50 * i + 100 * j != 50 * a.i + 100 * a.j)         return 50 * i + 100 * j < 50 * a.i + 100 * a.j;       return i > a.i;     }   };   rmdr r[100010];   int sz = 0;   int main() {     cin >> n >> k;     a[0] = a[1] = 0;     for (int i = 0; i < int(n); ++i) {       int tmp;       cin >> tmp;       if (tmp == 50)         a[0]++;       else         a[1]++;     }     memset(c, 0, sizeof(c));     c[0][0] = 1;     for (int i = int(1); i < int(n + 1); ++i) {       c[i][0] = 1;       for (int j = int(1); j < int(i + 1); ++j)         c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % P;     }     memset(cnt, 0, sizeof(cnt));     for (int i = 0; i < int(a[0] + 1); ++i)       for (int j = 0; j < int(a[1] + 1); ++j) dp[i][j] = 100500;     dp[0][0] = 0;     cnt[0][0] = 1;     for (int i = 0; i < int(a[0] + 1); ++i)       for (int j = 0; j < int(a[1] + 1); ++j) {         if (i == 0 && j == 0) continue;         r[sz].i = i, r[sz].j = j;         sz++;       }     sort(r, r + sz);     for (int z = 0; z < int(sz); ++z) {       int i = r[z].i, j = r[z].j;       if (50 * i + 100 * j <= k) {         dp[i][j] = 1;         cnt[i][j] = 1;         continue;       }       for (int i1 = 0; i1 < int(i + 1); ++i1)         for (int j1 = 0; j1 < int(j + 1); ++j1) {           if (i1 == 0 && j1 == 0) continue;           if (50 * i1 + 100 * j1 > k) break;           for (int i2 = 0; i2 < int(a[0] - i + i1 + 1); ++i2)             for (int j2 = 0; j2 < int(a[1] - j + j1 + 1); ++j2) {               if (i2 == 0 && j2 == 0) continue;               if (50 * i2 + 100 * j2 > k) break;               if (dp[i][j] >= dp[i - i1 + i2][j - j1 + j2] + 2) {                 long long tmp = (cnt[i - i1 + i2][j - j1 + j2] * c[i][i1]) % P;                 tmp = (tmp * c[j][j1]) % P;                 tmp = (tmp * c[a[0] - i + i1][i2]) % P;                 tmp = (tmp * c[a[1] - j + j1][j2]) % P;                 if (dp[i][j] > dp[i - i1 + i2][j - j1 + j2] + 2) {                   dp[i][j] = dp[i - i1 + i2][j - j1 + j2] + 2;                   cnt[i][j] = tmp;                 } else                   cnt[i][j] = (cnt[i][j] + tmp) % P;               }             }         }     }     if (dp[a[0]][a[1]] == 100500) {       printf( -1 n0 n );     } else {       printf( %d n%d n , dp[a[0]][a[1]], int(cnt[a[0]][a[1]]));     }     return 0;   }   