President Mohamed Nasheed resigns