#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
long long n, s;
long long dep[maxn];
int ck(long long mid) {
  long long nowp = 1, dep = 1, res = n, sum = 0;
  while (res > 0) {
    long long lon = min(res, nowp) * dep;
    sum += lon;
    if (sum > s) return 0;
    res -= min(nowp, res);
    nowp *= mid;
    dep++;
  }
  return 1;
}
int main() {
  scanf("%lld%lld", &n, &s);
  if (s < 2 * n - 1 || (n + 1) * n / 2 < s) return 0 * printf("NO\n");
  long long l = 1, r = n - 1, mide = -1;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (ck(mid)) {
      r = mid - 1;
      mide = mid;
    } else
      l = mid + 1;
  }
  long long sum = n * (n + 1) / 2, top = 2;
  for (int i = 1; i <= n; i++) {
    dep[i] = 1;
  }
  for (int i = n; i >= 1; i--) {
    if (dep[top] == dep[top - 1] * mide) top++;
    if (sum - s > i - top) {
      dep[top]++, dep[i]--;
      sum -= (i - top);
    } else {
      dep[i - (sum - s)]++;
      dep[i]--;
      sum = s;
      break;
    }
  }
  vector<int> ve[maxn];
  ve[1].push_back(1);
  int now = 1, f = 0, nowc = 2;
  printf("YES\n");
  while (now < n) {
    for (int j = 0; j < dep[nowc] && now < n; j++) {
      printf("%d%c", ve[nowc - 1][j / mide], now == n - 1 ? '\n' : ' ');
      ve[nowc].push_back(now + 1);
      now++;
    }
    nowc++;
  }
  return 0;
}
