
I have almost solved the question but I am stuck in the last part we know $X_1 , X_2,......,X_{(n-1)}$ and $Y_1, Y_2 ,.....Y_{(n-1)}$ can be filled only in one way, so the question reduces to filling the $(n-1) \times (m-1)$ table with $±1$ with out any condition i.e $2^{(n-1)(m-1)}$ but what about the green ( right bottom) box how can we fill that box?
Good work up to here. Now as you say, the question is whether we can fill in the lower right-hand corner consistently. In order to be able to do this, the product of the elements in the last column (except for the element in the lower right-hand corner of course) must be equal to the product of the elements in the the last row (again except for the lower right-hand corner).
When is this true?
Hint: Think about the product of all the numbers that are neither in the last column nor the last row.
Another Hint Let $P$ be the product of all the numbers that are neither in the last row nor the last column. The product of all the numbers in the first $n-1$ rows is $(-1)^{n-1},$ so the product of all the numbers in the last column, except for the one in the lower right-hand corner is $$\frac{(-1)^{n-1}}{P}$$
Make a similar argument about the last row. What can you conclude now?