#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cout << x; }
void __print(long x) { cout << x; }
void __print(long long x) { cout << x; }
void __print(unsigned x) { cout << x; }
void __print(unsigned long x) { cout << x; }
void __print(unsigned long long x) { cout << x; }
void __print(float x) { cout << x; }
void __print(double x) { cout << x; }
void __print(long double x) { cout << x; }
void __print(char x) { cout << '\'' << x << '\''; }
void __print(const char *x) { cout << '\"' << x << '\"'; }
void __print(const string &x) { cout << '\"' << x << '\"'; }
void __print(bool x) { cout << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cout << '{';
  __print(x.first);
  cout << ',';
  __print(x.second);
  cout << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cout << '{';
  for (auto &i : x) cout << (f++ ? "," : ""), __print(i);
  cout << "}";
}
void _print() { cout << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cout << ", ";
  _print(v...);
}
void line(long long x) {
  while (x--) {
    cout << "-";
  }
  cout << '\n';
}
template <typename T1, typename T2, typename T3>
void arr_(T1 *a, T2 x, T3 y) {
  for (int i = x; i <= y; i++) {
    cout << a[i] << " ";
  }
  cout << '\n';
}
template <typename T>
void queue_(queue<T> x) {
  while (!x.empty()) {
    T y = x.front();
    x.pop();
    cout << "["
         << "y"
         << "] = [";
    _print(y);
  }
  line(20);
}
template <typename T>
void stack_(stack<T> x) {
  while (!x.empty()) {
    T y = x.top();
    x.pop();
    cout << "["
         << "y"
         << "] = [";
    _print(y);
  }
  line(20);
}
template <typename T>
void pqueue_(priority_queue<T> x) {
  while (!x.empty()) {
    T y = x.top();
    x.pop();
    cout << "["
         << "y"
         << "] = [";
    _print(y);
  }
  line(20);
}
template <typename T1, typename T2, typename T3, typename T4, typename T5>
void arr2_(T1 *a, T2 x1, T3 x2, T4 y1, T5 y2) {
  for (int i = x1; i <= x2; i++) {
    for (int j = y1; j <= y2; j++) {
      cout << a[i][j] << " ";
    }
    cout << '\n';
  }
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T>
T rng2(T a, T b) {
  return a + rng() % (b - a + 1);
}
void start() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  srand(time(NULL));
}
long long power(long long x, long long y) {
  if (y == 0) {
    return 1;
  }
  long long p = power(x, y / 2);
  p = (p * p);
  return (y % 2 == 0) ? p : (x * p);
}
long long powm(long long x, long long y, long long m) {
  long long ans = 1, r = 1;
  x %= m;
  while (r > 0 && r <= y) {
    if (r & y) {
      ans *= x;
      ans %= m;
    }
    r <<= 1;
    x *= x;
    x %= m;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  long long lar = max(a, b);
  long long small = min(a, b);
  for (long long i = lar;; i += lar) {
    if (i % small == 0) {
      return i;
    }
  }
}
bool sortbysec(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  return (a.second < b.second);
}
bool sortbydec(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  return (a.first > b.first);
}
void dex(int a) {
  if (a == 1) {
    cout << "YES";
  }
  if (a == 2) {
    cout << "NO";
  }
  if (a == 3) {
    cout << "Yes";
  }
  if (a == 4) {
    cout << "No";
  }
}
bool overflow(long double a, long double b) { return a * b > 1e18 + 10; }
long long mod(long long a, long long b) { return ((a % b) + b) % b; }
long long mul(long long a, long long b, long long mod) {
  return ((a * 1ll * b) + mod) % mod;
}
long long modmul(long long a, long long b, long long mod) {
  long long res = 0;
  a %= mod;
  while (b) {
    if (b & 1) res = (res + a) % mod;
    a = (2 * a) % mod;
    b >>= 1;
  }
  return res;
}
long long modsum(long long a, long long b, long long mod) {
  return (a + b) % mod;
}
const long long N = (long long)(1e5 + 1);
const long long MOD = (long long)(1e9 + 7);
const long long inf = (long long)(1e18);
long long lowbit(long long x) {
  long long i = 0;
  while (x) {
    if (x & 1) {
      break;
    }
    i++;
    x >>= 1;
  }
  return i;
}
void solve(int tc) {
  long long sum, lim;
  cin >> sum >> lim;
  map<long long, long long> m;
  map<long long, set<long long> > m2;
  for (long long i = 1; i <= lim; i++) {
    long long y = lowbit(i);
    m[y]++;
    m2[y].insert(i);
  }
  long long a[18];
  memset(a, 0, sizeof(a));
  long long i = 0;
  while (sum) {
    if (sum & 1) {
      a[i] = 1;
    }
    i++;
    sum >>= 1;
  }
  long long f = 0;
  vector<long long> ans;
  for (long long j = 0; j <= 17; j++) {
    if (a[j]) {
      queue<pair<long long, long long> > q;
      q.push({j, 1});
      while ((long long)q.size()) {
        pair<long long, long long> p = q.front();
        q.pop();
        long long x = p.first;
        long long y = p.second;
        if (m.find(x) != m.end()) {
          if (m[x] >= y) {
            m[x] -= y;
            long long y2 = y;
            while (y2--) {
              auto it = m2[x].begin();
              ans.push_back(*it);
              m2[x].erase(it);
            }
            if (m[x] == 0) {
              m.erase(x);
            }
          } else {
            y -= m[x];
            long long y2 = m[x];
            m.erase(x);
            while (y2--) {
              auto it = m2[x].begin();
              ans.push_back(*it);
              m2[x].erase(it);
            }
            if (x == 0) {
              f = 1;
              break;
            }
            q.push({x - 1, y * 2});
          }
        } else {
          if (x == 0) {
            f = 1;
            break;
          }
          q.push({x - 1, y * 2});
        }
      }
    }
    if (f) {
      break;
    }
  }
  if (f) {
    cout << -1;
  } else {
    cout << (long long)ans.size() << '\n';
    for (auto it : ans) {
      cout << it << " ";
    }
  }
}
int main() {
  start();
  int t = 1;
  for (int tc = 1; tc <= t; tc++) {
    for (auto blockTime = make_pair(chrono::high_resolution_clock::now(), true);
         blockTime.second;
         fprintf(stderr, "%s: %lld ms\n", "solve",
                 chrono::duration_cast<chrono::milliseconds>(
                     chrono::high_resolution_clock::now() - blockTime.first)
                     .count()),
              fflush(stderr), blockTime.second = false) {
      solve(tc);
    }
  }
  return 0;
}

### Prompt

Develop a solution in cpp to the problem described below:

At the children's day, the child came to Picks's house, and messed his house up. Picks was angry at him. A lot of important things were lost, in particular the favorite set of Picks.

Fortunately, Picks remembers something about his set S:

  * its elements were distinct integers from 1 to limit; 
  * the value of <image> was equal to sum; here lowbit(x) equals 2k where k is the position of the first one in the binary representation of x. For example, lowbit(100102) = 102, lowbit(100012) = 12, lowbit(100002) = 100002 (binary representation). 



Can you help Picks and find any set S, that satisfies all the above conditions?

Input

The first line contains two integers: sum, limit (1 ≤ sum, limit ≤ 105).

Output

In the first line print an integer n (1 ≤ n ≤ 105), denoting the size of S. Then print the elements of set S in any order. If there are multiple answers, print any of them.

If it's impossible to find a suitable set, print -1.

Examples

Input

5 5


Output

2
4 5


Input

4 3


Output

3
2 3 1


Input

5 1


Output

-1

Note

In sample test 1: lowbit(4) = 4, lowbit(5) = 1, 4 + 1 = 5.

In sample test 2: lowbit(1) = 1, lowbit(2) = 2, lowbit(3) = 1, 1 + 2 + 1 = 4.

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cout << x; }
void __print(long x) { cout << x; }
void __print(long long x) { cout << x; }
void __print(unsigned x) { cout << x; }
void __print(unsigned long x) { cout << x; }
void __print(unsigned long long x) { cout << x; }
void __print(float x) { cout << x; }
void __print(double x) { cout << x; }
void __print(long double x) { cout << x; }
void __print(char x) { cout << '\'' << x << '\''; }
void __print(const char *x) { cout << '\"' << x << '\"'; }
void __print(const string &x) { cout << '\"' << x << '\"'; }
void __print(bool x) { cout << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cout << '{';
  __print(x.first);
  cout << ',';
  __print(x.second);
  cout << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cout << '{';
  for (auto &i : x) cout << (f++ ? "," : ""), __print(i);
  cout << "}";
}
void _print() { cout << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cout << ", ";
  _print(v...);
}
void line(long long x) {
  while (x--) {
    cout << "-";
  }
  cout << '\n';
}
template <typename T1, typename T2, typename T3>
void arr_(T1 *a, T2 x, T3 y) {
  for (int i = x; i <= y; i++) {
    cout << a[i] << " ";
  }
  cout << '\n';
}
template <typename T>
void queue_(queue<T> x) {
  while (!x.empty()) {
    T y = x.front();
    x.pop();
    cout << "["
         << "y"
         << "] = [";
    _print(y);
  }
  line(20);
}
template <typename T>
void stack_(stack<T> x) {
  while (!x.empty()) {
    T y = x.top();
    x.pop();
    cout << "["
         << "y"
         << "] = [";
    _print(y);
  }
  line(20);
}
template <typename T>
void pqueue_(priority_queue<T> x) {
  while (!x.empty()) {
    T y = x.top();
    x.pop();
    cout << "["
         << "y"
         << "] = [";
    _print(y);
  }
  line(20);
}
template <typename T1, typename T2, typename T3, typename T4, typename T5>
void arr2_(T1 *a, T2 x1, T3 x2, T4 y1, T5 y2) {
  for (int i = x1; i <= x2; i++) {
    for (int j = y1; j <= y2; j++) {
      cout << a[i][j] << " ";
    }
    cout << '\n';
  }
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T>
T rng2(T a, T b) {
  return a + rng() % (b - a + 1);
}
void start() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  srand(time(NULL));
}
long long power(long long x, long long y) {
  if (y == 0) {
    return 1;
  }
  long long p = power(x, y / 2);
  p = (p * p);
  return (y % 2 == 0) ? p : (x * p);
}
long long powm(long long x, long long y, long long m) {
  long long ans = 1, r = 1;
  x %= m;
  while (r > 0 && r <= y) {
    if (r & y) {
      ans *= x;
      ans %= m;
    }
    r <<= 1;
    x *= x;
    x %= m;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
  long long lar = max(a, b);
  long long small = min(a, b);
  for (long long i = lar;; i += lar) {
    if (i % small == 0) {
      return i;
    }
  }
}
bool sortbysec(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  return (a.second < b.second);
}
bool sortbydec(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  return (a.first > b.first);
}
void dex(int a) {
  if (a == 1) {
    cout << "YES";
  }
  if (a == 2) {
    cout << "NO";
  }
  if (a == 3) {
    cout << "Yes";
  }
  if (a == 4) {
    cout << "No";
  }
}
bool overflow(long double a, long double b) { return a * b > 1e18 + 10; }
long long mod(long long a, long long b) { return ((a % b) + b) % b; }
long long mul(long long a, long long b, long long mod) {
  return ((a * 1ll * b) + mod) % mod;
}
long long modmul(long long a, long long b, long long mod) {
  long long res = 0;
  a %= mod;
  while (b) {
    if (b & 1) res = (res + a) % mod;
    a = (2 * a) % mod;
    b >>= 1;
  }
  return res;
}
long long modsum(long long a, long long b, long long mod) {
  return (a + b) % mod;
}
const long long N = (long long)(1e5 + 1);
const long long MOD = (long long)(1e9 + 7);
const long long inf = (long long)(1e18);
long long lowbit(long long x) {
  long long i = 0;
  while (x) {
    if (x & 1) {
      break;
    }
    i++;
    x >>= 1;
  }
  return i;
}
void solve(int tc) {
  long long sum, lim;
  cin >> sum >> lim;
  map<long long, long long> m;
  map<long long, set<long long> > m2;
  for (long long i = 1; i <= lim; i++) {
    long long y = lowbit(i);
    m[y]++;
    m2[y].insert(i);
  }
  long long a[18];
  memset(a, 0, sizeof(a));
  long long i = 0;
  while (sum) {
    if (sum & 1) {
      a[i] = 1;
    }
    i++;
    sum >>= 1;
  }
  long long f = 0;
  vector<long long> ans;
  for (long long j = 0; j <= 17; j++) {
    if (a[j]) {
      queue<pair<long long, long long> > q;
      q.push({j, 1});
      while ((long long)q.size()) {
        pair<long long, long long> p = q.front();
        q.pop();
        long long x = p.first;
        long long y = p.second;
        if (m.find(x) != m.end()) {
          if (m[x] >= y) {
            m[x] -= y;
            long long y2 = y;
            while (y2--) {
              auto it = m2[x].begin();
              ans.push_back(*it);
              m2[x].erase(it);
            }
            if (m[x] == 0) {
              m.erase(x);
            }
          } else {
            y -= m[x];
            long long y2 = m[x];
            m.erase(x);
            while (y2--) {
              auto it = m2[x].begin();
              ans.push_back(*it);
              m2[x].erase(it);
            }
            if (x == 0) {
              f = 1;
              break;
            }
            q.push({x - 1, y * 2});
          }
        } else {
          if (x == 0) {
            f = 1;
            break;
          }
          q.push({x - 1, y * 2});
        }
      }
    }
    if (f) {
      break;
    }
  }
  if (f) {
    cout << -1;
  } else {
    cout << (long long)ans.size() << '\n';
    for (auto it : ans) {
      cout << it << " ";
    }
  }
}
int main() {
  start();
  int t = 1;
  for (int tc = 1; tc <= t; tc++) {
    for (auto blockTime = make_pair(chrono::high_resolution_clock::now(), true);
         blockTime.second;
         fprintf(stderr, "%s: %lld ms\n", "solve",
                 chrono::duration_cast<chrono::milliseconds>(
                     chrono::high_resolution_clock::now() - blockTime.first)
                     .count()),
              fflush(stderr), blockTime.second = false) {
      solve(tc);
    }
  }
  return 0;
}

```