Detailed Balance Implies Invariance