n, m = map(int, input().split())
service_costs = list(map(int, input().split()))

total_cost = sum(service_costs)

possible_costs = set()
for i in range(1, total_cost + 1):
    if total_cost % i == 0:
        possible_costs.add(i)

print(len(possible_costs))
print(*possible_costs)