#include <bits/stdc++.h>
#pragma GCC target ("sse4.2")

using namespace std;

bool home = 1;
typedef long long ll;
///#define int ll
typedef long double ld;
typedef unsigned long long ull;

signed realMain();

mt19937 rng_home(0);
mt19937 rng_oj((long long) (new char));

int rng() {
  if (home) {
    return rng_home();
  } else{
    return rng_oj();
  }
}

ull rng_ull() {
  return (ull) rng() * rng() ^ ((ull) rng() * rng());
}

int rng_range(int l, int r) {
  return l + abs(rng()) % (r - l + 1);
}

signed main() {
#ifdef ONLINE_JUDGE
  home = 0;
#endif
  if (home) {
    freopen ("tony_stark", "r", stdin);
  } else {
    ios::sync_with_stdio(0); cin.tie(0);
  }
  realMain();
}

const int N = 100 + 7;
const int K = 10000 + 7;
int n, a[N], b[K][N];

bool ok(int k) {
  for (int j = 1; j <= n; j++) {
    for (int i = 1; i <= k; i++) {
      b[i][j] = a[j] / k;
    }
    for (int i = 1; i <= a[j] % k; i++) {
      b[i][j]++;
    }
  }
  for (int i = 1; i <= k; i++) {
    for (int j = 1; j < n; j++) {
      if (b[i][j] == b[i][j + 1]) return 0;
      if ((b[i][j] > b[i][j + 1]) != (a[j] > a[j + 1])) {
        return 0;
      }
    }
  }
  return 1;
}

signed realMain() {
  cin >> n;
  n++;
  string do_not_need;
  cin >> do_not_need;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int l = 1, r = 10000, ret = 0;
  while (l <= r) {
    int m = (l + r) / 2;
    if (ok(m)) {
      ret = m;
      l = m + 1;
    } else {
      r = m - 1;
    }
  }
  ok(ret);
  cout << ret << "\n";
  for (int i = 1; i <= ret; i++) {
    for (int j = 1; j <= n; j++) {
      cout << b[i][j] << " ";
    }
    cout << "\n";
  }
  return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll N;
ll A[200];
ll memo[210][210];
ll f(int k, int a) {
	if (k == N) {
		if (a == 0)return 1;
		return 0;
	}
	if (memo[k][a] != -1)return memo[k][a];
	return memo[k][a] = min(100LL, f(k + 1, a) + f(k + 1, (a - A[k] + 400) % 200));
}
int main() {
	cin >> N;
	bool fff = 1;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		A[i] %= 200;
		if (A[i] > 0)fff = 0;
	}
	if (fff) {
		puts("Yes");
		puts("1 1");
		puts("1 2");
		return 0;
	}
	for (int i = 0; i < 210; i++)for (int j = 0; j < 210; j++)memo[i][j] = -1;
	for (int i = 199; i > 0; i--) {
		if (f(0, i) >= 2) {
			vector<int> B, C;
			int b = i, c = i;
			for (int j = 0; j < N; j++) {
				if (f(j + 1, b) && f(j + 1, (c - A[j] + 400) % 200)) {
					C.push_back(j);
					c = (c - A[j] + 400) % 200;
				}
				else if (f(j + 1, (b - A[j] + 400) % 200) && f(j + 1, c)) {
					B.push_back(j);
					b = (b - A[j] + 400) % 200;
				}
				else if (f(j + 1, (b - A[j] + 400) % 200) && f(j + 1, (c - A[j] + 400) % 200)) {
					C.push_back(j);
					c = (c - A[j] + 400) % 200;
					B.push_back(j);
					b = (b - A[j] + 400) % 200;
				}
				else {

				}
			}
			puts("Yes");
			cout << B.size();
			for (auto x : B) {
				cout << " " << x + 1;
			}
			cout << endl;
			cout << C.size();
			for (auto x : C) {
				cout << " " << x + 1;
			}
			cout << endl;
			return 0;
		}
	}
	puts("No");
}