Am I a Special N-bonacci Number? The N-bonacci sequence, originally invented by @DJMcMayhem in this question, is a sequence generated by starting with the integers 0 and 1, and then adding the previous N numbers to generate the next number.  The special N-bonacci sequence is an N-bonacci sequence beginning with a pair of numbers other than 0 and 1, which will be named X and Y.  If N is greater than the number of terms already in the sequence, simply add all available terms.  

So for example the normal fibonacci sequence has an N of 2 (takes the previous two items), and an X and Y of 0 and 1, or 1 and 1, depending on who you ask.  

Your Task:

You are to write a program or function that checks whether an inputted integer (A) is part of the special N-bonacci sequence generated by the next three integers (using the second input as N, and the third and fourth as X and Y).  Ensure that you handle the special case of N=1.  

Input:

Four non-negative integers, A, N, X, and Y.  

Output:

A truthy/falsy value that indicates whether A is part of the N-bonacci sequence generated by the N, X, and Y inputs.  

Test Cases:

Input:    Output:
13,2,0,1-&gt;truthy
12,3,1,4-&gt;falsy
4,5,0,1--&gt;truthy
8,1,8,9--&gt;truthy
9,1,8,9--&gt;truthy

12,5,0,1-&gt;falsy  [0,1]&gt;[0,1,1]&gt;[0,1,1,2]&gt;[0,1,1,2,4]&gt;[0,1,1,2,4,8]&gt;[0,1,1,2,4,8,16]&gt;etc.  


Scoring:

This is code-golf, so the lowest score in bytes wins.
05AB1E, 18 bytes

[DR²£O©‚˜³®&gt;‹#]³QZ


Try it online!



Uses: [X,Y], N, A



I feel like some unintended functionality made that harder than it needed to be.

There's no greater-than-or-equal-to, never noticed that before.

And #³ didn't work, and required a ], for +1 bytes #]³.