Usually, no. Gym contracts are famous for being tricky to get out of - however it might be worth contacting the gym or taking a look at the Ts & Cs in your contract. Without knowing which gym you're a member of it's hard me to be any clearer.
Good luck.