Why did the british surrender at Yorktown?

They were surrounded, outnumbered, out gunned and had no avenues of escape nor supply. They had only one other choice and that was to die fighting.