Is there any way to check whether an integer is a member of a list of integer numbers and return a boolean? 

I found this neat solution, [here](https://tex.stackexchange.com/a/260909/23594) that does a great job. It checks whether a string exists in a list of strings:

> 
> 
> ```
> \documentclass{article}
> \usepackage{xstring}
> \newcommand\IfStringInList[2]{\IfSubStr{,#2,}{,#1,}}
> \begin{document}
>     \IfStringInList{Paul}{George,John,Paul,Ringo}{True}{False}
> \end{document}
> 
> ```
> 
> 

However, it does return a string not a boolean "true" or "false" and caused me some difficulty which is posted [here](https://tex.stackexchange.com/q/501749/23594). 

Let's call the macro I would like to have `\ISMEMBER`. My goal is to use `\ISMEMBER` and examine whether an integer is in the list and depending on whether it is or not, perform some tasks, as an example:

```
\fpeval{ \ISMEMBER{1}{1,2,3,4,5} ? \MACRO_FOR_MEMBERS : \MACRO_FOR_NON_MEMBERS }

```

Is such functionality possible?