#include <iostream>
using namespace std;
const int N = 1e6 + 1;
int n,k,a[N];
struct SegmentTree {
    int sz = 1;
    long long tree[4*N];
    void init() {
        while (sz < n) sz<<=1;
        build(0,0,sz);

    }
    void build(int x, int lx, int rx) {
        if (rx - lx == 1) {
            if (lx < n) tree[x]=a[lx];
            else tree[x] = 0;
            return;
        }
        int mx = (lx + rx) / 2;
        build(x*2 + 1,lx,mx);
        build(x*2 + 2,mx,rx);
        tree[x] = tree[x*2+1] | tree[x*2+2];
    }
    long long qry(int l, int r) {
        return qry(l,r,0,0,sz);
    }
    long long qry(int l, int r, int x, int lx, int rx) {
        if (l<=lx && r>=rx) return tree[x];
        if (rx<=l || lx>=r) return 0;
        int mx = (lx + rx) / 2;
        long long a = qry(l,r,x*2+1,lx,mx);
        long long b = qry(l,r,x*2+2,mx,rx);
        return a|b;
    }
}st;
int main() {
    cin>>n>>k;
    int dp[n][k];
    int cnt = 0;
    for(int i=0;i<n;i++) {
        cin>>a[i];
        if (a[i] == 1) cnt++;

    }
    if (cnt>n-cnt) cout <<1;
    else cout <<0;
}
