fun readInt () = valOf (TextIO.scanStream (Int.scan StringCvt.DEC) TextIO.stdIn) fun isPossible _ nil = true | isPossible old (h::tl) = if Int.abs (old - h) = 1 then isPossible h tl else false val () = let val t = readInt () val x_s = List.tabulate (t, fn _ => readInt ()) val ans = if isPossible 0 x_s then "T" else "F" in print (ans ^ "\n") end