#include <iostream>
#include <vector>
#include <unordered_set>

std::vector<long long> calculatePossibleRoomCosts(int n, int m, std::vector<long long>& costs) {
  std::unordered_set<long long> possibleCosts;

  for (int i = 0; i < m; i++) {
    if (costs[i] % n == 0) {
      possibleCosts.insert(costs[i] / n);
    }
  }

  std::vector<long long> result;
  for (long long cost : possibleCosts) {
    result.push_back(cost);
  }

  return result;
}

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

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

  std::vector<long long> possibleCosts = calculatePossibleRoomCosts(n, m, costs);

  int k = possibleCosts.size();
  std::cout << k << std::endl;
  for (int i = 0; i < k; i++) {
    std::cout << possibleCosts[i] << " ";
  }
  std::cout << std::endl;

  return 0;
}
