#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>

using namespace std;

// Give numerical grade to the user
[[noreturn]] void grade(int result, string feedback="")
{
    cout << '1';
    erase(feedback, '\n');
    if (feedback != "") cout << ' ' << feedback;
    cout << '\n' << result << '\n';
    exit(0);
}
// Indicate that program failed to produce the right answer
[[noreturn]] void fail(string feedback="")
{
    cout << '0';
    erase(feedback, '\n');
    if (feedback != "") cout << ' ' << feedback;
    cout << '\n';
    exit(0);
}
// Indicate that the user output was accepted
[[noreturn]] void accept(string feedback="")
{
    cout << '1';
    erase(feedback, '\n');
    if (feedback != "") cout << ' ' << feedback;
    cout << '\n';
    exit(0);
}
#define SAFE_READ(x) \
    do               \
    {                \
        if (!(x))    \
            fail();  \
    } while (false)

int main(int argc, char **argv)
{
    string x1 = argv[1]; // correct output
    string x2 = argv[2]; // user output
    string x3 = argv[3]; // input
    ifstream correct, user, input;
    correct.open(x1);
    user.open(x2);
    input.open(x3);

    long long n, k;
    input>>n>>k;
    long long x[n];
    long long y[n];
    long long bound = 1000000000;
    for (int i = 0; i < n; i++) {
        SAFE_READ(user>>x[i]>>y[i]);
        if (x[i] < -bound || x[i] > bound || y[i] < -bound || y[i] > bound) fail();
    }

    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            if (x[i] == x[j] && y[i] == y[j]) fail();    
        }
    }

    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            long long d2 = (x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]);
            long long d = 0;
            long long inc = 1<<30;
            for (; inc >= 1; inc /= 2) {
                if ((d + inc) * (d + inc) <= d2) d += inc;
            }
            if (d * d == d2) {
                k--;
            }
        }
    }

    if (k) fail();
    accept();
}
