// PCK2018 Yosen Q9 on line
// YAMADA Terushige 2018.9.30.

#include <iostream>
#include <vector>
#include <map>
#include <cstdlib>

using namespace std;

int gcm(int a,int b){
  while(b!=0){
    int t=b;
    b=a%b;
    a=t;
  }
  return a;
}

struct point{
  int x,y;
  point(const int& px,const int& py):x(px),y(py) {};
};
  
pair <int,int> slope(point a,point b){
  int dx=a.x-b.x;
  int dy=a.y-b.y;
  if(dx<0){
    dx*=-1;
    dy*=-1;
  }
  int g=gcm(abs(dx),abs(dy));
  dx/=g;
  dy/=g;
  return make_pair(dx,dy);
}
	 
int main(){
  int N,K;
  cin >> N >> K;
  vector <point> p;
  for(int i=0;i<N;i++){
    int x,y;
    cin >> x >> y;
    p.push_back(point(x,y));
  }

  for(int i=0;i<N-1;i++){
    map < pair<int,int> ,int> sl;
    for(int j=i+1;j<N;j++){
      int num = ++sl[slope(p[i],p[j])];
      if(num >= K-1){
	cout << 1 << endl;
	return 0;
      }
    }
  }
  cout << 0 << endl;
  return 0;
}

