The problem is; I have a list of mixed elements `[Y, donkey, horse, 30, father(max)]`. I want to make a new list out of this with exclusively atoms.

I want to write a Prolog predicate called atoms/2 that, when supplied with a list in the first argument position, will instantiate the variable provided in the second argument position with the list of all atoms occurring in the inputlist (including any possible duplicate elements).

Like this:

```
?- atoms([Y, donkey, horse, 30, father(max)], Result).
Result = [donkey, horse].

```