I would like to allow Googlebot and Mediapartners-Google (AdSense useragent) to crawl my website. So I have written below code inside my robots.txt file.
User-agent: Googlebot
Disallow:
User-agent: Mediapartners-Google
Disallow:
Sitemap: http://website.com/sitemap.xml
Is the above robots.txt file is correctly written? Yes or no ?