#include <iostream>
#include <cmath>
#include <unordered_map>
#include <map>
using namespace std;
using llong = long long;

llong n, k;
llong x[3005];
llong y[3005];
unordered_map<double, llong> mp;
llong ans = 0;

int main() {
	cin >> n >> k;

	for (int i = 0; i < n; i++) {
		cin >> x[i] >> y[i];
	}

	for (int i = 0; i < n; i++) {
		mp.clear();
		for (int j = 0; j < n; j++) {
			if (i == j) continue;

			double idx = atan2(y[j] - y[i], x[j] - x[i]);
			mp[idx]++;

			if (mp[idx] >= k - 1) ans = 1;
		}
	}

	cout << ans << endl;

	return 0;
}

