#include <iostream>
using namespace std;

int a[1000001], br[2000001];

int main() {
    int n, k;
    int suma = 0;
    cin >> n >> k;
    for (int i = 0; i < n; i++)
        cin >> a[i];
    for (int i = 0; i < n; i++) {
        br[a[i] + n]++;
    }
    for (int i = 0; i < n * 2; i++) {
        if (br[i] >= 2)
            suma++;
    }
    cout << suma;
    for (int i = 0; i < n * 2; i++)
        if (br[i] >= 2)
            cout << i - n;
    return 0;
}