/*
Jackson Simoneau
SI@UCF 2026 - Intro to Competitive Programming

Solution to https://open.kattis.com/problems/trainpassengers
*/

#include <bits/stdc++.h>
using namespace std;

int main() {
    int c, n;
    cin >> c >> n;

    //Assume the train starts empty
    int p = 0;

    for(int i = 0; i < n; i++) {
        //Read in the information for one station
        int rem, add, wait;
        cin >> rem >> add >> wait;
        
        //Remove the passengers that leave the train
        //Make sure the occupancy is non-negative
        p -= rem;
        if(p < 0) {
            cout << "impossible\n";
            return 0;
        }

        //Add the passengers that board the train
        //Make sure the occupancy does not exceed the train capacity
        p += add;
        if(p > c) {
            cout << "impossible\n";
            return 0;
        }

        //Make sure no passengers are waiting if there is space on the train
        //Also make sure no one is waiting if this is the last station (i = n-1)
        if(wait > 0 && (p < c || i == n-1)) {
            cout << "impossible\n";
            return 0;
        }
    }

    //Make sure the train is empty after the last station
    if(p > 0) {
        cout << "impossible\n";
    } else {
        //All conditions were satisfied, so the input is consistent
        cout << "possible\n";
    }
}