Sum column A when something is in column B

I have two colum, the first one have number on it and the second one have some cell filled.

how could i do a conditional somme instruction for calculating only number that have a corespondiong not empty cell?

Had not found how to do that complexe function :frowning:

Where A1:A5 contains the numbers and B1:B5 the are cells to be not empty.

=SUMIF(B1:B5,"<>",A1:A5)