The line “To be or not to be” comes from which play ?

The line “To be or not to be” comes from which play ?

A. Macbeth
B. Twelfth Night
C. A Midsummer Night’s dream
D. Hamlet