#include using namespace std; using Position = std::pair; struct Rational { int num; int denum = 1; Rational() = default; Rational(int x) : num(x) {} Rational(int x, int y) : num(x), denum(y) { shorten(); } void shorten() { int g = __gcd(num ,denum); if (g < 0) g = -g; num /= g; denum /= g; } Rational& operator+=(Rational other) { num *= other.denum; other.num *= denum; num += other.num; denum *= other.denum; shorten(); return *this; } Rational& operator-=(Rational other) { num *= other.denum; other.num *= denum; num -= other.num; denum *= other.denum; shorten(); return *this; } friend Rational operator+(Rational first, Rational other) { return first+=other; } friend Rational operator-(Rational first, Rational other) { return first-=other; } Rational& operator*=(Rational other) { num *= other.num; denum *= other.denum; shorten(); return *this; } Rational& operator/=(Rational other) { num *= other.denum; denum *= other.num; shorten(); return *this; } friend Rational operator*(Rational first, Rational other) { return first*=other; } friend Rational operator/(Rational first, Rational other) { return first/=other; } bool operator<(Rational other) const { return num * other.denum < other.num * denum; } }; int main() { int count, percent; std::cin >> count >> percent; std::vector positions (count); for (int i = 0; i < count; ++i) { Position p; std::cin >> p.first >> p.second; positions[i] = p; } std::map, int>> parallels; for (int i = 0; i < count; ++i) { for (int j = i+1; j < count; ++j) { Position dist = {positions[i].first - positions[j].first, positions[i].second - positions[j].second}; if (dist.first < 0) dist = {-dist.first, -dist.second}; else if (!dist.first && dist.second < 0) dist = {0, -dist.second}; int g = __gcd(dist.first ,dist.second); if (g < 0) g = -g; dist = {dist.first/g, dist.second/g}; Position rect = {dist.second, -dist.first}; std::pair center = { Rational{positions[i].first + positions[j].first, 2}, Rational{positions[i].second + positions[j].second, 2}}; if (rect.first) center = {{0, 1}, center.second - center.first / rect.first * rect.second}; else center = {center.first - center.second / rect.second * rect.first, 0}; if (parallels[dist].count(center)) ++ parallels[dist][center]; else parallels[dist][center] = 1; } } for (auto parallel : parallels) { for (auto center : parallel.second) if (center.second * 200 >= count * percent) { std::cout << "YES\n"; return 0; } } std::cout << "NO\n"; return 0; }