Gordon's theorem for overpartitions