#include <bits/stdc++.h>

using namespace std;

int main()
{
    long n,k,s;
    s=0;
    scanf("%ld%ld",&n,&k);
    long a[n];
    long c[n];
    long b[n];
    long d[n];

    for (long i=1;i<n+1;i++)
        b[i]=0;
    for (long i=0;i<n+1;i++)
        d[i]=0;



    for (long i=0;i<n;i++)
    {
        scanf("%ld",&a[i]);
        if (a[i]>0){b[a[i]]=b[a[i]]+1;}
        if (a[i]<=0){d[abs(a[i])]=d[abs(a[i])]+1;}
    }
    for (long i=1;i<n+1;i++)
    {
        if (b[i]>=k){c[s]=i;s=s+1;}
    }

    for (long i=0;i<n+1;i++)
    {
        if (d[i]>=k){c[s]=-i;s=s+1;}
    }

    printf("%ld",s);
    printf("\n");
    for (int i=0;i<s;i++)
        printf("%ld ",c[i]);


    return 0;
}