I am wondering if there is any keyboard shortcut to close the ads (advertisement) on YouTube.
For example, as the one as in the picture below.
This answer doesn't directly relate to your specific keyboard shortcut, but I thought I'd mention it anyways since alternatives are being mentioned.
Ironically, given the ad is for Raspberry Pi beta testers, another option for hiding/blocking the ads is to purchase a Raspberry Pi and set up Pi-Hole which can be used to block ads network wide.
The Pi-hole can block ads for all devices on your network. All you need is a Raspberry Pi connected to your router. It was inspired as a low-cost, open source alternative to the AdTrap.
Currently, over...1.6 million (if you decide to use the mahakala source list) domains known to serve advertisements can be blocked before they even reach your computer. The list of these domains are maintained by different sites across the Internet. The Pi-hole queries these sites and compiles them into an aggregated list, which is then stored on the Raspberry Pi to block advertisements.