n, m = map(int, input().split()) A = list(map(int, input().split())) P = list(map(int, input().split())) dp = [[False] * (m + 1) for _ in range(n + 1)] dp[n][0] = True for i in range(n - 1, -1, -1): dp[i] = dp[i + 1].copy() a = A[i] for j in range(a, m + 1): dp[i][j] |= dp[i + 1][j - a] if not dp[0][m]: print(-1) exit() inv = [0] * n for i, p in enumerate(P): inv[p - 1] = i l = -1 ans = [] while m: for i in inv: if i <= l: continue a = A[i] if m >= a and dp[i][m] and dp[i + 1][m - a]: l = i ans.append(i + 1) m -= a break print(len(ans)) print(*ans)