public static void main(String[] args){
		
		Scanner in = new Scanner(System.in);
		
		int sum = in.nextInt();
		int limit = in.nextInt();
		int curr = 0;
		lower = new int[limit+1];
		ArrayList<Integer> out = new ArrayList<Integer>();
		HashSet<Integer> used = new HashSet<Integer>();
		while(curr<sum){
			int old = curr;
			for(int i=limit;i>0;i--){
				int num=findLower(i);
//				System.out.println(curr+" "+num);
				if(!used.contains(i) && num <= sum-curr){
					used.add(i);
					curr+=num;
					out.add(i);
				}
			}
			if(curr == old) break;
		}
		if(curr!=sum) System.out.println(-1);
		else{
			System.out.println(out.size());
			StringBuilder sb = new StringBuilder();
			for(int i:out){
				sb.append(i);
				sb.append(" ");
			}
			sb.append("\n");
			System.out.println(sb.toString());
		}
	}