#include "bits/stdc++.h"

using namespace std;
using uint = unsigned int;
using int64 = long long;
using i64 = int64;
using uint64 = unsigned long long;
using vint = vector<int>;
using vint64 = vector<int64>;
template<typename T>
using p_que = priority_queue<T>;
#define rep(i,N) for(int i=0;i<(int)(N);++i)
#define rep1(i,N) for(int i=1;i<=(int)(N);++i)
#define fs first
#define sc second
#define eb emplace_back
#define all(x) x.begin(),x.end()

template<typename T>
vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v(ts...))>(a, make_v(ts...));
}

template<class T> ostream& operator<<(ostream& os, const vector<T>& v) {
	os << "[";
	for (auto& e : v) os << e << ", ";
	return os << "]";
}

template<class T, class U> ostream& operator<<(ostream& os, const pair<T, U> p) {
	return os << "P(" << p.first << ", " << p.second << ")";
}

template<class T, class U> ostream& operator<<(ostream& os, const map<T, U>& mp) {
	os << "{";
	for (auto& e : mp) os << e << " ";
	return os << "}";
}

void Main();
signed main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(20);
	Main();
}

/* Cut from here! */

template <uint mod> struct ModInt {
	uint x;
	ModInt(int64_t y = 0) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod) {}
	ModInt& operator+=(const ModInt& p) {
		if ((x += p.x) >= mod) x -= mod;
		return *this;
	}
	ModInt& operator-=(const ModInt& p) {
		x = (int)(1ll * x * p.x % mod);
		return *this;
	}
	ModInt& operator/=(const ModInt& p) {
		*this *= p.inverse();
		return *this;
	}
	ModInt operator-() const {
		return ModInt(-x);
	}
	ModInt operator+(const ModInt& p) const {
		return ModInt(*this) += p;
	}
	ModInt operator-(const ModInt& p) const {
		return ModInt(*this) -= p;
	}
	ModInt operator*(const ModInt& p) const {
		return ModInt(*this) *= p;
	}
	ModInt operator/(const ModInt& p) const {
		return ModInt(*this) /= p;
	}
	bool operator==(const ModInt& p) const {
		return x == p.x;
	}
	bool operator!=(const ModInt& p) const {
		return x != p.x;
	}
	ModInt inverse() const {
		int a = x, b = mod, u = 1, v = 0, t;
		while (b > 0) {
			t = a / b;
			swap(a -= t * b, b);
			swap(u -= t * v, v);
		}
		return ModInt(u);
	}
	ModInt pow(int64_t n) const {
		ModInt ret(1), mul(x);
		while (n > 0) {
			if (n & 1) ret *= mul;
			mul *= mul;
			n >>= 1;
		}return ret;
	}
	friend ostream& operator<<(ostream& os, const ModInt& p) {
		return os << p.x;
	}
};


//#define int long long
const uint MOD = 1e9 + 7;

template<typename T>
T gcd(T x, T y) {
	if (x == 0 || y == 0) return 1;
	T r;
	while ((r = y % x) != 0) {
		y = x;
		x = r;
	}
	return x;
}

template<typename T>
void swaper(T& a, T& b) {
	a = a ^ b;
	b = a ^ b;
	a = a ^ b;
}

void print(const multiset<int>& s) {
	for (auto& e : s) cout << e << endl;
}

using pi=pair<int, int>;

void Main() {
	int N, K; cin >> N >> K;
	vector<pi> P;
	rep(i, N) {
		int x, y; cin >> x >> y;
		P.eb(x, y);
	}

	int INF = 37564;
	int ans = 0;
	for (int i = 0; i < N; ++i) {
		// << i << " : " << endl;
		map<pi, int> m;
		for (int j = 0; j < N; ++j) {
			if (i == j) continue;
			int ax, ay, bx, by;
			tie(ax, ay) = P[i], tie(bx, by) = P[j];
			if (bx - ax == 0) {
				++m[pi(INF,0)];
			}
			else if (by - ay == 0) {
				++m[pi(0, INF)];
			}
			else {
				int g = gcd(by - ay, bx - ax);
				++m[pi((by - ay) / g, (bx - ax) / g)];
			}
		}
		for (auto& e : m) {
			//cout << "  " << e << endl;
			if (e.second >= K-1) ans = 1;
		}
	}
	cout << ans << endl;
}


Measured memory_bytes: 3324