object Main extends App {
  import scala.io.StdIn._
  val Array(h, w) = readLine.trim.split(' ').map(_.toInt)
  val state = new State(Array.tabulate(h){_ ⇒ readLine.trim})
  println(
    if (state.grundyNumberAt(0, w - 1, 0, h - 1) == 0) "Second"
    else "First"
  )
  class State(state: Array[String]) {
    private val memo: Array[Array[Array[Array[Option[Int]]]]] = Array.tabulate(state.head.length){_ ⇒ Array.tabulate(state.head.length){_ ⇒ Array.tabulate(state.length){_ ⇒ Array.tabulate(state.length){_ ⇒ None: Option[Int]}}}}
    private val isMarked: Array[Array[Boolean]] = state.map(str ⇒ str.map(_ == 'X').toArray)
    def grundyNumberAt(left: Int, right: Int, top: Int, bottom: Int): Int = {
      if (left > right || top > bottom) 0
      else memo(left)(right)(top)(bottom) match {
        case Some(r) ⇒ r
        case None if left == right || top == bottom ⇒
          if ((left to right).forall(x ⇒ (top to bottom).forall(y ⇒ isMarked(y)(x)))) {
            memo(left)(right)(top)(bottom) = Some(0)
            0
          }
          else {
            memo(left)(right)(top)(bottom) = Some(1)
            1
          }

        case None ⇒
          val next = (left to right).flatMap(x ⇒
            (top to bottom).withFilter(y ⇒ !isMarked(y)(x)).map(y ⇒
              grundyNumberAt(left, x - 1, top, y - 1) ^
                grundyNumberAt(x + 1, right, top, y - 1) ^
                grundyNumberAt(left, x - 1, y + 1, bottom) ^
              grundyNumberAt(x + 1, right, y + 1, bottom)
            )).distinct.toSet
          val g = (0 to 1000).find(i ⇒ !next.contains(i)).get
          memo(left)(right)(top)(bottom) = Some(g)
          g
      }
    }
  }
}
