Santa Claus wants to give a present to every child in a certain neighborhood. Every house in the neighborhood has a child, so Santa must visit every house and deliver a present. This year Rudolph, who carries Santa, has a poor sense of direction and cannot land anywhere except on a building. So Santa wants to plan out how to deliver the presents in advance.
The neighborhood is divided into 1×1 cells, and each cell is a house, a church, or empty land. There is exactly one church. Santa and Rudolph start at the church, deliver a present to every house, and must return to the church. They must obey the following rules.
Given the layout of the neighborhood, write a program that finds the number of ways Santa and Rudolph can deliver the presents.
The first line contains the width $m$ and the height $n$ of the neighborhood, separated by a space. ($1 \le m, n \le 10$) Each of the next $n$ lines contains $m$ numbers separated by spaces. Each number describes the state of that cell and is one of 0, 1, 2: 0 is empty land, 1 is a house, and 2 is the church. There is always exactly one church, and the number of houses is between 1 and 23, inclusive.
Print the number of ways the presents can be delivered. This value is guaranteed to be at most 2,000,000.