#include <iostream>
#include <algorithm>
using namespace std;
int chisla[2000],minimales[20000];
int main(){
int n,s;
cin>>s>>n;
for(int a=0;a<n;a++){

cin>>chisla[a];
minimales[a]=1;}
if(minimales[s]!=0){cout<<1;}
return 0;
}
