#include <bits/stdc++.h>
using namespace std;
struct hash_pair {
  template <class T1, class T2>
  size_t operator()(const pair<T1, T2> &p) const {
    auto hash1 = hash<T1>{}(p.first);
    auto hash2 = hash<T2>{}(p.second);
    return hash1 ^ hash2;
  }
};
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return (a / gcd(a, b)) * b;
}
long long int mul(long long int a, long long int b, long long int m) {
  long long int a1 = a / 1000000, a2 = a % 1000000;
  long long int b1 = b / 1000000, b2 = b % 1000000;
  long long int x = a1 * (b1 * 1000000000000LL % m) % m;
  long long int y = (a1 * b2 + a2 * b1) % m * 1000000 % m;
  long long int z = a2 * b2;
  long long int res = (x + y + z) % m;
  return res;
}
long long int mod_pow(long long int a, long long int b, long long int m) {
  long long int x = 1, y = a;
  while (b) {
    if (b & 1) {
      x = mul(x, y, m);
    }
    y = mul(y, y, m);
    b >>= 1;
  }
  return x;
}
string num_str(long long int a) {
  string str;
  while (a) {
    str.push_back('0' + a % 10);
    a /= 10;
  }
  return str;
}
long long int str_num(string str) {
  long long int num = 0;
  for (long long int i = 0; i < str.size(); i++) num = num * 10 + str[i] - '0';
  return num;
}
long long int binarySearch(vector<pair<long long int, long long int> > &arr,
                           long long int l, long long int r, long long int x) {
  if (r >= l) {
    long long int mid = l + (r - l) / 2;
    if (arr[mid].first == x) return mid;
    if (arr[mid].first > x) return binarySearch(arr, l, mid - 1, x);
    return binarySearch(arr, mid + 1, r, x);
  }
  return l - 1;
}
vector<long long int> num_binary(long long int num) {
  vector<long long int> bin;
  do {
    bin.push_back(num % 2);
    num /= 2;
  } while (num);
  return bin;
}
long long int binary_num(vector<long long int> &bin) {
  long long int num = 1, sum = 0;
  for (long long int i = 0; i < bin.size(); i++) {
    if (bin[i] != 0) sum += num;
    num *= 2;
  }
  return sum;
}
bool check_sqrt(long long int n) {
  long long int i = 1;
  for (; i * i <= n; i++)
    ;
  i--;
  return i * i == n;
}
bool check_prime(long long int n) {
  for (long long int i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
bool check(vector<long long int> a, vector<long long int> b) {
  for (long long int i = 0; i < a.size(); i++)
    if (a[i] != b[i]) return false;
  return true;
}
long long int modInverse(long long int n, long long int p) {
  return mod_pow(n, p - 2, p);
}
long long int nCrModPFermat(long long int n, long long int r, long long int p) {
  if (n < r) return 0;
  if (r == 0) return 1;
  vector<long long int> fac(n + 1);
  fac[0] = 1;
  for (long long int i = 1; i <= n; i++) fac[i] = (fac[i - 1] * i) % p;
  return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) %
         p;
}
void solve() {
  long long int sum, limit, index = 17;
  cin >> sum >> limit;
  vector<long long int> ans;
  vector<stack<pair<long long int, long long int> > > arr(18);
  for (long long int i = 1; i < limit + 1; i++) {
    long long int num = i;
    long long int bit = 1;
    long long int index = 1;
    while (num % 2 != 1) {
      bit *= 2;
      num /= 2;
      index++;
    }
    arr[index].push(make_pair(bit, i));
  }
  while (sum > 0 && index > -1) {
    while (arr[index].empty() && index > -1) index--;
    if (index < 0) break;
    if (sum >= arr[index].top().first) {
      sum -= arr[index].top().first;
      ans.push_back(arr[index].top().second);
      arr[index].pop();
      index = arr[index].empty() ? index - 1 : index;
    } else
      index--;
  }
  if (sum == 0) {
    cout << ans.size() << "\n";
    for (long long int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  } else
    cout << -1;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  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;
struct hash_pair {
  template <class T1, class T2>
  size_t operator()(const pair<T1, T2> &p) const {
    auto hash1 = hash<T1>{}(p.first);
    auto hash2 = hash<T2>{}(p.second);
    return hash1 ^ hash2;
  }
};
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return (a / gcd(a, b)) * b;
}
long long int mul(long long int a, long long int b, long long int m) {
  long long int a1 = a / 1000000, a2 = a % 1000000;
  long long int b1 = b / 1000000, b2 = b % 1000000;
  long long int x = a1 * (b1 * 1000000000000LL % m) % m;
  long long int y = (a1 * b2 + a2 * b1) % m * 1000000 % m;
  long long int z = a2 * b2;
  long long int res = (x + y + z) % m;
  return res;
}
long long int mod_pow(long long int a, long long int b, long long int m) {
  long long int x = 1, y = a;
  while (b) {
    if (b & 1) {
      x = mul(x, y, m);
    }
    y = mul(y, y, m);
    b >>= 1;
  }
  return x;
}
string num_str(long long int a) {
  string str;
  while (a) {
    str.push_back('0' + a % 10);
    a /= 10;
  }
  return str;
}
long long int str_num(string str) {
  long long int num = 0;
  for (long long int i = 0; i < str.size(); i++) num = num * 10 + str[i] - '0';
  return num;
}
long long int binarySearch(vector<pair<long long int, long long int> > &arr,
                           long long int l, long long int r, long long int x) {
  if (r >= l) {
    long long int mid = l + (r - l) / 2;
    if (arr[mid].first == x) return mid;
    if (arr[mid].first > x) return binarySearch(arr, l, mid - 1, x);
    return binarySearch(arr, mid + 1, r, x);
  }
  return l - 1;
}
vector<long long int> num_binary(long long int num) {
  vector<long long int> bin;
  do {
    bin.push_back(num % 2);
    num /= 2;
  } while (num);
  return bin;
}
long long int binary_num(vector<long long int> &bin) {
  long long int num = 1, sum = 0;
  for (long long int i = 0; i < bin.size(); i++) {
    if (bin[i] != 0) sum += num;
    num *= 2;
  }
  return sum;
}
bool check_sqrt(long long int n) {
  long long int i = 1;
  for (; i * i <= n; i++)
    ;
  i--;
  return i * i == n;
}
bool check_prime(long long int n) {
  for (long long int i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
bool check(vector<long long int> a, vector<long long int> b) {
  for (long long int i = 0; i < a.size(); i++)
    if (a[i] != b[i]) return false;
  return true;
}
long long int modInverse(long long int n, long long int p) {
  return mod_pow(n, p - 2, p);
}
long long int nCrModPFermat(long long int n, long long int r, long long int p) {
  if (n < r) return 0;
  if (r == 0) return 1;
  vector<long long int> fac(n + 1);
  fac[0] = 1;
  for (long long int i = 1; i <= n; i++) fac[i] = (fac[i - 1] * i) % p;
  return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) %
         p;
}
void solve() {
  long long int sum, limit, index = 17;
  cin >> sum >> limit;
  vector<long long int> ans;
  vector<stack<pair<long long int, long long int> > > arr(18);
  for (long long int i = 1; i < limit + 1; i++) {
    long long int num = i;
    long long int bit = 1;
    long long int index = 1;
    while (num % 2 != 1) {
      bit *= 2;
      num /= 2;
      index++;
    }
    arr[index].push(make_pair(bit, i));
  }
  while (sum > 0 && index > -1) {
    while (arr[index].empty() && index > -1) index--;
    if (index < 0) break;
    if (sum >= arr[index].top().first) {
      sum -= arr[index].top().first;
      ans.push_back(arr[index].top().second);
      arr[index].pop();
      index = arr[index].empty() ? index - 1 : index;
    } else
      index--;
  }
  if (sum == 0) {
    cout << ans.size() << "\n";
    for (long long int i = 0; i < ans.size(); i++) cout << ans[i] << " ";
  } else
    cout << -1;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}

```