import java.math.BigInteger;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class SolutionIvan {
    public static void main(String[] args) throws Exception {
        new SolutionIvan().run();
    }

    void run() throws Exception {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int r = scanner.nextInt();
        List<List<Integer>> students =
                IntStream.range(0, 2*n).mapToObj((int i) -> new ArrayList<Integer>(r)).collect(Collectors.toList());
        for (int i = 0; i < r; ++i) {
            for (int j = 0; j < 2*n; ++j) {
                students.get(j).add(scanner.nextInt());
            }
        }
        List<List<Boolean>> topSkills = new ArrayList<>();
        for (List<Integer> skills : students) {
            List<Boolean> topSkill = skills.stream().map(i -> (i > n)).toList();
            List<Boolean> bottomSkill = topSkill.stream().map(s -> !s).toList();
            if (topSkill.get(0)) {
                topSkills.add(topSkill);
            } else {
                topSkills.add(bottomSkill);
            }
        }

        Comparator<List<Boolean>> cmp = (lhs, rhs) -> {
            for (int i = 0; i < r; ++i) {
                if (lhs.get(i) != rhs.get(i)) {
                    return Boolean.compare(lhs.get(i), rhs.get(i));
                }
            }
            return 0;
        };

        topSkills.sort(cmp);
        for (int i = 0; i < 2*n; i += 2) {
            if (cmp.compare(topSkills.get(0), topSkills.get(1)) != 0) {
                System.out.println("impossible");
                return;
            }
        }
        System.out.println("possible");
    }
}

