Close the menu opened with Y with Y again.

Hello, when I press Y here, the menu opens. Similarly, when this menu is open, I want the menu to close when I press Y again, how do I do this?