Can you scatter vegetation on a landscape using a mask?

Hi. I want to scatter my rocks on my landscape, but only on those parts where is the sand. I have a mask for sand, I am using it to blend textures. Can I scatter some rocks using that mask as distribution mask?

The answer is to use Procedural Foliage Spawner and use a landscape paint layer as a mask