Avoiding the zero problem
I totally agree with Esmailian.

Naive Bayes is Naive - Assumes Independence.

Steps:


Calculate Independently
Smooth using Laplacian smoothing (to avoid zeroing the whole value)


Additional Tip:


Use log instead of multiplying the probabilities. (this will make sure that your values are not closing to zero, keeping some context.)


Example:

$$p(a) = p(x1)\cdot p(x2)$$

Applying logarithm,

$$\log(p(a)) = \log(p(x_1)) + \log(p(x_2))$$

As you need to finally classify, taking the log won't hurt.