The biggest and the smallest of the world's animals are most at risk of dying out, according to a new analysis.