A Necessary and Sufficient Condition for A Matrix to be Totally Unimodular