import Control.Applicative
import qualified Data.Set (Set)
import qualified Data.Set as S
import Prelude

solver0 ::Int-> [[Int]]->Set Int
solver0 n xss = S.fromList [last xs|xs<-xss, (head xs) == 1]

solver1 ::Int-> [[Int]]->[Int]
solver1 n xss = [head xs|xs<-xss, (last xs) == n]

solver00 :: Set Int -> [Int] -> [Int]
solver00 s1 xs = [x|x<-xs, x `S.elem` s1]

myshow xs
    |length xs == 0 = "IMPOSSIBLE"
    |otherwise = "POSSIbLE"

main :: IO ()
main = do
    [n, m] <- map read . words <$> getLine 
    xss <- replicateM m $ map read . words <$> getLine ::IO [[Int]]
    putSrtLn $ myshow $ solver00 (solver0 n xss) (solver1 n xss)

    

