def find_possible_costs(n, m, service_costs):
    total_cost = sum(service_costs)
    possible_costs = set()
    for possible_cost in range(1, total_cost + 1):
        accommodation_cost = (total_cost - possible_cost) // n
        
        if accommodation_cost >= 0 and accommodation_cost * n + possible_cost == total_cost:
            possible_costs.add(accommodation_cost)
    return possible_costs
n, m = map(int, input().split())
service_costs = list(map(int, input().split()))
result = find_possible_costs(n, m, service_costs)
print(len(result))
print(*result)
