Typically yes is an affirmative response, but it could be used as an exclamation to express one's delight. For example, someone near you may have exclaimed "Yes!" when Lord Business finally started using the Kragle on those "Everything is Awesome" - singing people in the Lego movie.