Take upwards as positive, when a ball is thrown upwards, the acceleration due to gravity is during the upward motion and during the downward motion.