#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>
#include <algorithm>
#include <cstdlib>
#include <vector>
#define R register
#define IN inline
#define gc getchar()
#define ll long long
#define MX 105
template <class T>
IN void in(T &x)
{
	x = 0; R char c = gc;
	for (; !isdigit(c); c = gc);
	for (;  isdigit(c); c = gc)
	x = (x << 1) + (x << 3) + c - 48;
}
int n, sum;
std::vector <int> eve, odd;
int main(void)
{
	in(sum), in(n);
	int foo;
	for (R int i = 1; i <= n; ++i)
	{
		in(foo);
		if (foo & 1) odd.push_back(foo);
		else eve.push_back(foo);
	}
	if (n == 1)
	{
		if (sum == 1) printf("1\n1\n1");
		else printf("%d\n2\n%d %d", sum, 1, sum - 1);
		return 0;
	}
	if (odd.size() > 2) return puts("Impossible"), 0;
	else if (odd.size() == 2)
	{
		if (odd[0] > odd[1]) std::swap(odd[0], odd[1]);
		printf("%d ", odd[0]);
		for (auto i : eve) printf("%d ", i);
		printf("%d\n", odd[1]);
		odd[0]--, odd[1]++;
		if (!odd[0]) printf("%d\n", n - 1);
		else printf("%d\n%d ", n, odd[0]);
		for (auto i : eve) printf("%d ", i);
		printf("%d ", odd[1]);
	}
	else if (odd.size() == 1)
	{
		printf("%d ", odd[0]);
		for (auto i : eve) printf("%d ", i);
		puts("");
		odd[0]++, eve[eve.size() - 1]--;
		printf("%d\n", n);
		printf("%d ", odd[0]);
		for (auto i : eve) printf("%d ", i);
	}
	else
	{
		for (auto i : eve) printf("%d ", i);
		eve[0]++, eve[eve.size() - 1]--;
		printf("\n%d\n", n);
		for (auto i : eve) printf("%d ", i);
	}
}
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const int INF = 1001001001;
const int MOD = 1000000007;

template <typename T>
void print(const T &v);

const int MAX = 510'000;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit()
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

long long COM(int n, int k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

vector<pair<ll, ll>>
factorization(ll num)
{
    map<ll, ll> mp;

    ll tmp = num;
    for (ll i = 2; i * i <= num; i++)
    {
        while (tmp % i == 0)
        {
            mp[i]++;
            tmp /= i;
        }
    }
    if (tmp != 1)
    {
        mp[num]++;
    }
    vector<pair<ll, ll>> ret;
    for (auto m : mp)
    {
        ret.push_back(make_pair(m.first, m.second));
    }
    return ret;
}

int main()
{
    COMinit();
    int n, m;
    cin >> n >> m;

    auto fac = factorization(m);
    ll ans = 1;
    for (int i = 0; i < fac.size(); i++)
    {
        int tmp = fac[i].second;
        ans = (ans * COM(n + tmp - 1, tmp)) % MOD;
    }
    cout << ans << endl;
    return 0;
}

// Use For Debug
template <typename T>
void print(T const &v)
{
    for (int i = 0; i < v.size(); i++)
    {
        if (i)
            cout << " ";
        cout << v[i];
    }
    cout << endl;
}
