Can we train Yes vs No in the same way as cat vs dog

no either with cats vs dogs
or with cats vs pictures with noncats(you have to create this dataset)(watch haarcascade video on youtube you will be able to get how to create a dataset)