#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;

    vector<int> costs(m);
    for (int i = 0; i < m; i++) {
        cin >> costs[i];
    }

    sort(costs.begin(), costs.end());

    vector<int> possible_prices;

    for (int i = 1; i <= m; i++) {
        if (m % i == 0) {
            int price = costs[i - 1] / i;
            bool valid = true;

            for (int j = i; j < m; j += i) {
                if (costs[j] / (j / i) != price) {
                    valid = false;
                    break;
                }
            }

            if (valid) {
                possible_prices.push_back(price);
            }
        }
    }

    sort(possible_prices.begin(), possible_prices.end());
    possible_prices.erase(unique(possible_prices.begin(), possible_prices.end()), possible_prices.end());

    cout << possible_prices.size() << endl;
    for (int i = 0; i < possible_prices.size(); i++) {
        cout << possible_prices[i] << " ";
    }
    cout << endl;

    return 0;
}