If the mentioned coffee beans are contaminated with the feces of the animal - even by a little bit - then it is not permissible to consume the coffee that is made from such beans. If the contaminated beans are made tahir before using them to make the coffee, then it is permissible to consume the coffee.