I have dates like:

21.05.2014
21.05.2014
21.05.2015

A1:A3


and the coresponding numbers next to it

100
60
200

B1:B3


I need a SUM of the number if and only if the year is 2014, or 2015, etc. How do I do that?