Joint Chiefs Chairman Gen. Martin Dempsey, who flew into Afghanistan Monday, says that under optimum circumstances the U.S. will need about four months to pull all troops and equipment out of Afghanistan if there is no agreement allowing them to stay into 2015.

But Dempsey says the U.S. can act quickly to pull out if needed. He says the military has a plan ready should the current election stalemate continue.

All American forces will leave Afghanistan if no agreement is signed.

Both presidential contenders say they will sign it.