#include <iostream>
using namespace std;

int main() {

    int day, month;
    cin >> day >> month;

    if(month == 1 || month == 3 || month == 5 ||
       month == 7 || month == 8 || month == 10 || month == 12) {
        if(day >= 1 && day <= 31) {
            cout << "ok";
        } else {
            cout << "not ok";
        }
    } else if(month == 4 || month == 6 || month == 9 || month == 11) {
        if(day >= 1 && day <= 30) {
            cout << "ok";
        } else {
            cout << "not ok";
        }
    } else if(month == 2) {
        if(day >= 1 && day <= 28) {
            cout << "ok";
        } else {
            cout << "not ok";
        }
    } else {
        cout << "not ok";
    }

    cout << endl;

    return 0;
}
