Not showing list if there aren’t any categories to display

<?php
$master_cat = get_category_by_slug( 'Master' );
$master_cat_id = $master_cat->term_id; 
$slave_cat = get_category_by_slug( 'Slave' );
$slave_cat_id = $slave_cat->term_id;
$categories = wp_list_categories( 'echo=0&show_option_none=&orderby=name&title_li=&exclude=".$master_cat_id.",'.$slave_cat_id );
if ( $categories ) : ?>
    <ul>
        <li><p>Categories:</p></li>
        <?php echo $categories ?>
    </ul>
<?php endif; ?>