Condition: IF Xpath then

Hi there. Im trying to loop a pagination button.

Im looking for a condition which does the following:
If the Xpath Button exist -> Click, otherwise do nothing.

Is that possible with keyboard Maestro or do i need a javascript for this?