[Question]
  [
## The Narrative
You are a frog who is at the edge of a pond with waterlilies. You would like to cross the pond without getting wet, so you plan to jump from lily to lily. There is, however, one problem: you are a rare species of frog which can only jump one specific distance, and so you might not be able to cross the pond no matter what you do.
## The Objective
Determine if the frog can cross the pond without getting wet.  
**Your program should take two inputs:**
* A string or list of lily-y/watery values to represent the lilies in the pond
* A positive integer which tells how far the frog jumps
**Your program should output a truthy/falsy value to indicate whether the pond is crossable**
The frog can start any distance behind the edge of the pond, but may not start on a lily or in the water. Additionally, the frog may finish any distance beyond the far edge of the pond, but not on a lily or in the water. Note that the frog cannot move at any interval other than that which is specified in the input (i.e. With a jumping distance of `3`, the pond `001100` is not crossable, even though it appears that the frog could walk from the first waterlily to the second)  
Examples:
```
(lily=1, water=0)
Inputs: "001101001111001", "3"
Output: "Yes"
Inputs: "101001", "2"
Output: "No"
Inputs: "010000001", "7"
Output: "Yes"
Inputs: "00000", "6"
Output: "Yes"
Inputs: "00000", "5"
Output: "No"
Inputs: "00100100", "4"
Output: "No"
Inputs: "001100", "3"
Output: "No"
Inputs: "", "1"
Output: "Yes"
(note that output does not have to be "Yes" or "No", but any truthy/falsy values)
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest code in bytes wins.
  
[Answer]
# [BitCycle](https://github.com/dloscutoff/esolangs/tree/master/BitCycle), 329 bytes
BitCycle is certainly not an easy language to solve this in, despite the fact that its only form of data (streams of bits), easily represents the pattern of the lilypond in this challenge.
None of the mathematical solutions used in the other answers here would be at all easy to implement in BitCycle, so the basic algorithm for this program is as follows: given the jump length `N` and the pond string `P`, take every `N`th bit of `P`, AND those bits together to determine if this pond is crossable, and repeat this for every possible starting distance from the pond, ORing the results from each variation together to determine if any are crossable.
This program takes the bitstring representing the lilypond as its first input (with 1s as lilies and 0s as water), and the jump length in unary (bitcycles normal way of representing integers) as the second input.
```
v      <
   v       ~^  v  <  <>  v F>\^Hv
  Gv            E^   ^~   + > + !
1>Gv>v  ^=~      >    ^v+vF^  H>/
  ?B^>   ^    Cv^\=/^^v~ v
  v ~ ^   >    D  ^   >
   ?~     v~^^<v~D/Bvv   <
  0AG\ ^^= ~>  \^^  < >
  B      ^ >^ ~<?~    =
>  B^ >1B^  v /v~<0C^E^
 ^   ~~   Gv0C>D>    E^
  ^        < ^~    ~
      Bv
       >      ~
```
## More in-depth explanation
*(will come later, when I feel like digging through this code to figure out how each piece of it works again)*
[Try it online!](https://tio.run/##VZA9bsMwDIV3nYKdM9jaZRqVnTiHMN4QI0OBjgWBLry6QpHOEP0QFPU9kdTj5@/4P36frQn5KInodEnhfrHF3bvxjrsYsL0JH1fDCGrmQmz7K2XehI3BpIFwN5CL3Iy982BvzBU92rW0CPZpAERJPL963FVrMGxxmuM5UaCIrkMVOUsev7edgInURDvQq@6SGvlBDNIS@ikZUy2Uqzc4iJZxwRXJM2mHNhkXXjnaS2eZ/j/RKWmKc5XTiWrtorWWx4/Zcn4B "BitCycle – Try It Online") or [Dlosc's online visualizer](https://dloscutoff.github.io/Esolangs/BitCycle/?p=sc6wrc2sc7znc2sc2wc2wec2scFeinHsrc2Gsc9c3Enc3nzc3tcectcbr1eGsesc2nozc6ec4nstsFnc2Hejrc2qBnec3nc4Csniojn2szcsrc2sczcnc3ec4Dc2nc3erc3qzc5szn2wszDjBs2c3wrc20AGicn2oczec2in2c2wcerc2Bc6ncenczwqzc4orec2Bnce1Bnc2scjszw0CnEnrcnc3z2c3Gs0CeDec4Enrc2nc8wcnzc4zrc6Bsrc7ec6zc&i=MTAxMDEwMTAxMDEwMQoxMQ__) (To test inputs on TIO, they must be put into the arguments section, rather than the input section.)
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 5 bytes
```
T%QL<
```
[Try it online!](https://tio.run/##y0rNyan8/z9ENdDH5n/eo4a5hoeXn5yu/6hpTeT//9FKBgaGhgaGINIQRCrpKBjH6ihEK0EEgVwjMBfEAwGQiDlEBASAPDMozxCMgAImsQA "Jelly – Try It Online")
*Look ma, no Unicode!*
Takes a list of 0 for lilies and 1 for water on the left, and the stride on the right.
```
   L     The number of
  Q      unique
T        indices of water
 %       modulo the stride
    <    is less than the stride.
```
The frog must traverse every index with some chosen residue modulo the stride; this checks if there's any residue which does not at any point correspond to water.
# [Jelly](https://github.com/DennisMitchell/jelly), 6 bytes
```
s×ƒR}Ẹ
```
[Try it online!](https://tio.run/##y0rNyan8/7/48PRjk4JqH@7a8d/2UcNcw8PLT07Xf9S0JvL//2glAwNDQwNDEGkIIpV0FIxjdRSilSCCQK4RmAvigQBIxBwiAgJAnhmUZwhGQAGTWAA "Jelly – Try It Online")
Takes a list of 1 for lilies and 0 for water on the left, and the stride on the right. (Without having to handle strides longer than the pond itself, could just be `sPẸ`.)
```
s         Split the pond into stride-sized slices.
  ƒ       Reduce the list of slices by
 ×        vectorizing multiplication
   R}     starting with [1..stride] (all-truthy and the appropriate length).
     Ẹ    Is any value truthy?
```
[Answer]
# [R](https://www.r-project.org/), 64 bytes
```
function(x,y)length(table(which(strsplit(x,'')[[1]]=='0')%%y))<y
```
[Try it online!](https://tio.run/##LYnBCsIwEETvfoUESnYhh6yKXsyXlB60NCYQorQrmq@P2dZhGHhv5upd9e88cnxm@JqCacoPDsC3e5rgE@IYYOF5eaXI7dca@56GwTltNXZdQbyW6kFZS2RJlmSVOeKu6c0psz@sKCQRc9mMpNH5T7S2iRPW@gM "R – Try It Online")
If allowed to take a boolean list instead:
# [R](https://www.r-project.org/), 42 bytes
```
function(x,y)length(table(which(!x)%%y))<y
```
[Try it online!](https://tio.run/##Zc3BCsIwDADQ@75iDkYb2GFR0Yv9krGDjnYrjG60FVfEb6/LFEUXQgJ5CbFxtHK0QyOdS0WqrqbxejDceatNC/e5u7HX/j0oGIOqwroWgiF7JErEz8lUBOilaX3H/fnSS37rdNPxzQR5HgBOISr@fcazskQskSpSzaDYQfK78vJZ0u0/kVAselwpBclhLbgk4R6SGJ8 "R – Try It Online")
Can cut that down to 41 if I can flip the lily-y and watery states, losing the ! in the process.
1 byte reduced because `table` is one byte shorter than `unique`.
Basic idea: look at values mod the jump length, any residue that has a 0 is not a residue you can completely jump across, if not all of them have 0 then you can jump across. Some residues may be empty (and thus fine), e.g. if you have 6 pads and can jump across 7 then there are no pads at 0 mod 7 and you can jump straight across the pond.
This is equivalent to the solutions of <https://codegolf.stackexchange.com/users/73593/matteo-c>.
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal) `r`, 6 bytes
```
T%UL⁰>
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJyIiwiIiwiVCVVTOKBsD4iLCIiLCJbMSwgMSwgMSwgMSwgMV1cbjYiXQ==)
Port of Jelly answer.
## How?
```
T%UL⁰>
T      # Truthy (water) indices of the (implicit) first input 
 %     # Modulo each by the (implicit) second input (the stride)
  U    # Uniquify
   L   # Length
    ⁰> # Is the second input (the stride) greater than this?
```
[Answer]
# [Python](https://www.python.org), ~~62~~ ~~47~~ 46 bytes
*thanks to [@Unrelated String](https://codegolf.stackexchange.com/users/85334/unrelated-string) for the idea of alternative input format*
*-1 byte thanks to [@dingledooper](https://codegolf.stackexchange.com/users/88546/dingledooper)*
```
f=lambda p,n:0in(0in p[i::n]for i in range(n))
```
[Attempt This Online!](https://ato.pxeger.com/run?1=fZLBSsQwEIbxmqcY5pRALY0rKoE-gBc9S-2hYrsGumlosrL6Kl72ou-k-DDOJIpFWEMSksz3z2QmeXnzT_Fhcvv96zYOxxfv5VCP3ebuvgNfOFNZJ2mAb6wxrh2mGSzQfu7cupdOqaz6OPoMUAMiikvntzEYwKrSutI8a56xAFyhuN5GspP5pg8ofumMMnSygK6mJcMIt4SdH_aVIGbO_mN06oyd_onIaQjOJ5QhztZLvHWoyuBHG0fr-iCVEDZ5AqKa_rEb5S7bJRpUjW4VcK12XKvQVMas2lZMKUg4LKnrfM-lVmetSKUvJj58pivl8AV8-1RGADU_WxclYSpvC0fBbF7TarQhyk3H6liAV5lKDMmcWvgYJIkVFYdTz4_880W-AA)
# [C (gcc)](https://gcc.gnu.org/), ~~118~~ 110 bytes
*-8 bytes thanks to [@ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat)*
```
d,i,j,n,l,c;main(c,v)char**v;{for(n=atoi(v++[2]);c=i<n;d+=c)for(j=i++;j<strlen(*v);j+=n)c&=j[*v]-48;return d;}
```
[Try it online!](https://tio.run/##FcmxDsIgEADQX3EywNEE1MHkel/SdCBHVUi9JrSyGL8dw/KWx8OTubVok81W7GoZ3yGJYls1v0IxpuL3sRUlFI4tqQowXWaNTGkUjECs@2ZKAJjH/SjrIspUjRlINJ8pT6bOw@2OZTk@RU4Rf60157x3vuu77foH "C (gcc) – Try It Online")
# [Haskell](https://www.haskell.org/), ~~50~~ 48 bytes
*-2 bytes thanks to [@Unrelated String](https://codegolf.stackexchange.com/users/85334/unrelated-string)*
```
p#n=any(\i->all(p!!)[i,i+n..length p-1])[0..n-1]
```
[Try it online!](https://tio.run/##LYj/CoIwFIVfxR@B99IcW0b903yDnkAlRkiO5mWYQj792rTD4XC@b9Cfd2@t9y4npWmF1pS1thZcmmJjmDkS57an1zwkrpQdNoJzCseP2pAatbs/wE2GZr7Qc5mmFXLk0MKXrVjWAEoVssDboY4CsYFMCCmFjCvjZiypkCWQ7TLgacNIMdFcdxMT6PInuTWIM3b@Bw "Haskell – Try It Online")
All the solutions do basically the same thing.
[Answer]
# [R](https://www.r-project.org/), ~~37~~ ~~36~~ 34 bytes
*Edit: -2 bytes thanks to Giuseppe*
```
function(x,y)(y:0)[1:y*-!c(x,1:y)]
```
[Try it online!](https://tio.run/##hc/BCsIwDADQ@76i7tJGJjQqCoNe/QJvY6fRSmFspZ3gEL@9NnOoIMwQkhBeKfHRee183@gQmGLm2jWD7TsRBm@7C9xTD661w7woOIeqwrpWiiN/ZEbF95NbMYIYSwkVluN6s2rSJk1QR2uEEZ9/RC4lokSqSDWHYgdwZroNmp2yH/6ySbHtEiNFMcnjoqQgdVhWOCXB/R84s68zYnwC "R – Try It Online")
Outputs zero for falsy, and a vector with non-zero first element (which is truthy in [R](https://www.r-project.org/)) for truthy.
(test setup stolen from [Cong Chen's R answer](https://codegolf.stackexchange.com/a/247312/95126)...)
[Answer]
# Desmos, ~~85~~ 62 bytes
```
f(l,s)=max(0,sign(s-mod([1...l.length][l=0],s).unique.length))
```
*-23 bytes thanks to Aiden Chow*
[Try it on Desmos!](https://www.desmos.com/calculator/ucsrg0jryz)
[Answer]
# [Java (JDK)](http://jdk.java.net/), 67 bytes
```
(j,l,s)->{int r=1<<j;for(l|=--r>>s%j<<s;l>0;l>>=j)r&=l;return r>0;}
```
[Try it online!](https://tio.run/##bZFRi5wwEMff91MMC1tiiaJ3pYW6@tKnQguFe1z2IedGGxsTmYkL1@1@djvR63LXVmKcGec/P/JPr84q7U8/ZjOMHgP0nGdTMDZrJ9cE4132ttw0VhHBV2UcXDYAxgWNrWo0fDH26Zt3p0/oiTTCBR69t1o5aJRbioKboZ@GUUYZWGONpjUm81MnJVx54jg9WtMABRX4c/bmBAPTxENA47rDERR2lCxw@Afaou@gmkUvraQkrS9xOFbFft@XrUdhf1VpinVNu36/p9LWOb911Sf4prIl6jChA@TqdS4XAItAnBVGKnx8xQaI9VGhGgiq@Cuj0ZogthK2SfmiZz0p93xmtzqNGYtIcyJW9SE/yrub4oUwmvU/2V@sQ3F8xUNNkw0sjHZkN/tX6//YfkNnVrsufBfJbcbDEwU9ZH4K2cimh1ZsdwRpDTvaOSYyXj5DnjXx4q6b6zzneVHkRdyLuEu4n9dcwt0cg/hw8mFeIgnvo2RZEt6tco7ufwM "Java (JDK) – Try It Online")
Takes input as three `int`s: the jump size, the lily pond as an integer and the size of the pond
## Explanations
```
(j,l,s)->{                     // 3 parameters: jump size, lilies positions, pond size
 int r=(1<<j)-1;               // Result. By default all entries are crossable
 for(
   l|=r>>s%j<<s;               // Ensure the banks of the pond are jumpables.
   l>0;                        // Stop when all jumps are done
   l>>=j)                      // Prepare the next jump
  r&=l;                        // Do all tests for the n-th jump at once.
 return r>0;                   // Return whether any jump line fully succeeded.
}
```
# Credits
* -2 bytes thanks to [ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat)
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 5 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
ι€ßĀà
```
First input is the jump-distance, second the string of water/lilies with `0`/`1` similar as the challenge description.
[Try it online](https://tio.run/##yy9OTMpM/f//3M5HTWsOzz/ScHjB//9mXAYgAAA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfWVC8f9zOx81rTk8/0jD4QX/df5HRxvrKBkYGBoaGIJIQxCpFKujEG2kowQRA/PMgYqAHBCACJiBdAEBmGMCNgKMwHyYkUBeLAA).
5 instead of 6 bytes by taking advantage of [a bug in 05AB1E that causes `Ā` to be truthy for empty strings `""`](https://github.com/Adriandmen/05AB1E/issues/189). The 6 byter without bug-abuse would have been [`ι€ß_ß_`](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfWVC8f9zOx81rTk8Px6I/uv8j4421lEyMDA0NDAEkYYgUilWRyHaSEcJIgbmmQMVATkgABEwA@kCAjDHBGwEGIH5MCOBvFgA). (It could have been 4 bytes [`ι€ßà`](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfWVC8f9zOx81rTk8//CC/zr/o6ONdZQMDAwNDQxBpCGIVIrVUYg20lGCiIF55kBFQA4IQATMQLqAAMwxARsBRmA@zEggLxYA) if the length of water/lilies string was \$\geq\$ the jump-distance, which isn't the case for test case `6,"00000"`.)
**Explanation:**
```
ι      # Uninterleave the (implicit) second input-string to the (implicit)
       # first input-integer amount of parts
 €ß    # Get the minimum of each part
   Ā   # Transform empty strings to 1s with a bugged Python-style truthify
    à  # Get the maximum of this list
       # (which is output implicitly as result)
```
[Answer]
# [C(GCC)](https://gcc.gnu.org/), ~~105~~ 99 bytes
*-6 bytes thanks to [@ceilingcat](https://codegolf.stackexchange.com/users/52904/ceilingcat)*, but I want to keep the inside while
```
j(a,b)char*a;{char*c=a,*d=a,m=1,o=0;for(;c-a<b;o|=m++,d=c++)while(*++d)m&=*d-48||(d-c)%b;return o;}
```
[Try it online](https://tio.run/##dY9BDoIwEEXXcgrSBNPSadIqUZOxN3FTWlFIANPgCjg70upSfiZ/knlvM1Y8rF2WhhoomX0anxsc47baQO7WarWCXkusek/RCnMtsZ90yzk4bTln8Z5z7pC1e507UVymiTphWVaivw9v36U9zktr6o6yMdm9fN0NFSVZfesIpA0lUiolVWgVmsCRMfwnfi0Chw0ecMiqnLeUEAKnTaziECii8XtAYjIvHw) The idea is to try all possible starting points and then go through the whole string and do something only when on a place the frog lands. If frog's jumping power would be limited to 32 max, it would be possible to golf more (88 bytes), like:
```
j(a,b)char*a;{char*d=a;unsigned m=(1<<b)-1;while(*++d)m&=-1u^49-*d<<(d-a)%b;return !!m;}
```
[Try it online](https://tio.run/##dY9dC4IwFIav81fIwNiXsJVUsPZPupmbppJbDKML9bcvZ13my@GBw/vA4ej8rnUIHdSN8ljR1g5picZ101JRbBb0klMnmaidh0Ln6loKIzUhaHw37aOCGBJiEOr3Epu8uEwTNLlGWSncJHtCxOyr4eVt6sQcetVaiMZk9/TLrRqCrL1ZQNMOAsY4ZzySRwJ6REj8E78WoIeNPtYxi3LeUmIAPW3WfB1Ai9X4PcBEMocP) Here I would simply have a bitflag for each possible start, and use !! to normalize the result.
[Answer]
# Minecraft Command Blocks, 403 bytes
[![stack of command blocks](https://i.stack.imgur.com/Gisvu.png)](https://i.stack.imgur.com/Gisvu.png)
The commands in the command blocks from left to right:
```
scoreboard objectives add o dummy
execute store result score d o run data get storage a d
data modify storage a c set from storage a b[0]
execute if data storage a {c:0} run scoreboard players add c o 1
execute if data storage a {c:1} run scoreboard players reset c
data remove storage a b[0]
execute if score c o = d o run say 0
setblock 0 0 0 air
execute unless data storage a b[0] run say 1
setblock 0 0 0 air
```
Input is given with the command `/data merge storage a {d:2,b:[0,1,0,1...]}` where `d` is the frog's jump length and `b` is an array representing the lily pads.
## Explanation
When the lever is pressed, the repeating command block (purple) executes every gametick, with the chain command blocks (green) executing after it in sequence. The third-last and last command blocks are conditional, which means they will only execute if the previous command block was successful.
```
scoreboard objectives add o dummy                                   Create scoreboard objective to store variables in
execute store result score d o run data get storage a d             Store the jump distance in d
data modify storage a c set from storage a b[0]                     Get the first value of the lily pad array
execute if data storage a {c:0} run scoreboard players add c o 1    If the value is zero increment the jump counter by 1
execute if data storage a {c:1} run scoreboard players reset c      If the value is one reset the jump counter
data remove storage a b[0]                                          Delete the first value of the array
execute if score c o = d o run say 0                                If the jump counter is equal to the jump distance print 0 (fail)
setblock 0 0 0 air                                                  (conditional) Delete the lever to stop the loop
execute unless data storage a b[0] run say 1                        If the array is empty print 1 (success)
setblock 0 0 0 air                                                  (conditional) Delete the lever to stop the loop
```
[Answer]
# [HBL](https://github.com/dloscutoff/hbl), 19 [bytes](https://github.com/dloscutoff/hbl/blob/main/docs/codepage.md)
```
?('?,)1(1,)('?.(2.,
+(*(),(<2(*-(0,)).
```
Takes two arguments: a list of 1s and 0s, and an integer. Returns 0 for falsey and a nonzero integer for truthy. [Try it at HBL online!](https://dloscutoff.github.io/hbl/?f=0&p=PygnPywpMSgxLCkoJz8uKDIuLAorKCooKSwoPDIoKi0oMCwpKS4_&a=KDAgMCAxIDEgMCAwKQoz)
### Explanation
The first line is a recursive helper function that takes the number as its first argument and a partial list as its second argument:
```
?('?,)1(1,)('?.(2.,
?                    If
    ,                 the second argument
 ('? )                is empty, then:
      1                Return 1 (we've reached the other side of the pond)
                     Else, if
       (1 )           the first item in
         ,            the second argument
                      is truthy (nonzero), then:
           ('?         Recur
              .        with same first argument
                       and second argument equal to
               (2       drop
                 .      (first argument) many items
                  ,     from the front of second argument
                     Else, return the falsey value from the last test (0)
```
The result will be 1 if the pond can be crossed by starting with the first lily, 0 otherwise.
Then the main function trims off between 0 and N-1 elements from the start of the list, applies the helper function to each trimmed list, and sums the results:
```
+(*(),(<2(*-(0,)).
              ,     Second argument (jump distance)
            (0 )    Inclusive range from 1 to that number
         (*     )   Map
           -         decrement
        2           Drop that many
      (<             for each of those numbers
                 .   from first argument (list of lily pads)
 (*                 For each of those lists
   ()                call the helper function
     ,               with main function's second argument as first argument
                     and the trimmed list as second argument
+                   Sum
```
[Answer]
# [Pip](https://github.com/dloscutoff/pip) `-xp`, 9 bytes
```
$|$&*aUWb
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m724ILNgebSSbkWBUuyCpaUlaboWK1VqVNS0EkPDkyB8qPCWaKVoQ2sDaxAGkrFKOgpGMC0A) Or, [verify all test cases](https://ato.pxeger.com/run?1=m724ILNgWbSSboBS7MLqpaUlaboWK1VqVNS0EkPDkyD8mxtqFXxDFaK5oqMNFAwUDIHQAIwhbEMYO1bBOBaoBkk2VsEoFqwLwodBoLh5LNQ0MIxVMEPjm8bCbYOTsQomsShuMECx0RDuhliIuxcsgNAA).
### Explanation
```
$|$&*aUWb
     a     First command-line input (list of 1s and 0s)
      UW   Unweave into this many strands:
        b  Second command-line input (jump distance)
  $&*      Fold each of those strands on logical AND
$|         Fold the list of results on logical OR
```
That is, there must be at least one strand which contains only 1s.
[Answer]
# JavaScript (ES6), 52 bytes
Expects `(distance)(string)`.
```
(n,k=n)=>g=s=>k--&&[...s].every((x,i)=>i%n|x)|g(1+s)
```
[Try it online!](https://tio.run/##dY5RC4IwFIXf@xUySO4lna6inuZP6D2iB7EpS9nChRj439emJBV4uJyX893DueddbopWPp6x0jdhS25BRTVXyLOKG57VcRyGF0qpuVLRifYF0EfSpXKthh6HCtjGoC20MroRtNEVlLBDIGnKWMq8M@8EMUiSgJyFIatfeuvoCSUYfDTRJ/0PH321Y71mfrH6MA5x@mpepvfT7PHmh3mIfQM "JavaScript (Node.js) – Try It Online")
[Answer]
# [Factor](https://factorcode.org/), 52 bytes
```
[| s n | n 1 s indices [ n mod ] map cardinality > ]
```
[Try it online!](https://tio.run/##XU/BCoJAFLz7FdM9QisKirxGly7RSTws60oL62q7GyG6327PRLHeMMvMG3jL5Iy70nT32@V6PkCVnCkLK54vobmwKJh7kHUWlRHO1ZWR2oFZW3KLYxA0AWgaQkQICdGXgw4n7bEh9rMgf8KbOWGWFJygpKorlk2H5ic81vCzL4b9iD7f/@QjPHZ/@3D2emwp9UGXtLDQaIkRKakz2ZdOyBdlhpTqV@DMZFIzJV2NGGmXD/XjPlt1Hw "Factor – Try It Online")
Port of Unrelated String's first [Jelly answer](https://codegolf.stackexchange.com/a/247303/97916).
```
               ! s = { 1 1 0 0 1 0 1 1 0 0 0 0 1 1 0 }, n = 3
n              ! 3
1              ! 3 1
s              ! 3 1 { 1 1 0 0 1 0 1 1 0 0 0 0 1 1 0 }
indices        ! 3 V{ 0 1 4 6 7 12 13 }
[ n mod ] map  ! 3 V{ 0 1 1 0 1 0 1 }
cardinality    ! 3 2
>              ! t
```
[Answer]
# [J](http://jsoftware.com/), 19 16 bytes
```
[>#@~.@(|[:I.-.)
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/o@2UHer0HDRqoq089XT1NP9rcvk56SlE24EFPfUcgGJgEW09fQcNjRrlGE0tfX29WE0dNUOu1OSMfAVDBVsFY4U0oJkGQLYhmISxDWFsiFIDoFIjoFIkRQgzzKBmgCFC2BwsbIiQQjXOBG4znPwPAA "J – Try It Online")
*-3 taking the approach from [Unrelated String's jelly answer](https://codegolf.stackexchange.com/a/247303/15469)*
## original answer [J](http://jsoftware.com/), 19 bytes
```
+./@((|#\)*//.]),&1
```
[Try it online!](https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/tfX0HTQ0apRjNLX09fViNXXUDP9rcqUmZ@QrGCrYKhgrpAEVGwDZhmASxjaEsSFKDYBKjYBKkRQhzDCDmgGGCGFzsLAhQgrVOBO4zXDyPwA "J – Try It Online")
Consider `3 f 0 0 1 1 0 1 0 0 1 1 1 1 0 0 1`:
* `,&1` Append a 1:
```
0 0 1 1 0 1 0 0 1 1 1 1 0 0 1 1
```
* `(|#\)` Label each 1..n and then mod by 3:
```
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
1 2 0 1 2 0 1 2 0 1  2  0  1  2  0  1   <-- mod 3
```
* `*//.]` Use the last row to group the original input, and take the product of each group:
```
0 0 1 1 0 1 0 0 1 1 1 1 0 0 1 1
1 2 0 1 2 0 1 2 0 1 2 0 1 2 0 1   <-- mod 3
0 1 0 1 0 1│0 0 0 1 0│1 1 1 1 1
     ^          ^         ^
  1-group    2-group    0-group
     0     │    0    │    1    
     ^          ^         ^
  1-group    2-group    0-group
  product    product    product
```
* `+./@` Is there a 1 among them? That indicates a valid path.
```
1
```
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki/The-Language), 48 bytes
```
~(L$`.+$
*
C`\B
.+
^(^.{0,$&}1|$&*.1)$*.{0,$&}\n
```
[Try it online!](https://tio.run/##K0otycxLNPyvqhGcoPO/TsNHJUFPW4VLi8s5IcaJS0@bK04jTq/aQEdFrdawRkVNS89QU0ULKhCT9/@/gYGhoYEhiDQEkTrGXBCujhEXiAYBQx1zLjBDxwxIG4KRjgkA "Retina – Try It Online") Takes pond and jump size on separate lines but link is to test suite that splits on comma for convenience. Explanation:
```
~(
```
After running the rest of the program, treat the result as its own Retina program, and execute that on the original input.
```
L$`.+$
*
C`\B
```
Delete the pond and decrement the jump size.
```
.+
^(^.{0,$&}1|$&*.1)$*.{0,$&}\n
```
Replace the decremented jump size with a regular expression that matches crossable ponds. Example: If the jump size is `7`, then the following expression is produced:
```
^(^.{0,6}1|......1)*.{0,6}\n
```
This optionally matches up to six digits and a `1` followed by multiple matches of six digits and a `1`, finishing with up to six digits and the newline that separates the pond from the jump size.
[Answer]
# [C++ (clang)](http://clang.llvm.org/), 91 bytes
```
[](auto p,int s){int i=s,j,a,r=0;for(;a=i;r|=a)for(j=--i;j<p.size();j+=s)a&=p[j];return r;}
```
[Try it online!](https://tio.run/##lZJNS8QwEIbPza8YKmiDqazfsGnXk1dPgoh6CG2sKdskJGlR1/3r1rRd3G9ESBlm3j6Zd6bNtI6zKZNFeyBkNq1zDolQ1hnOqglCjld6yhxP3IfmklUc7ieoUSL3inXRPWglcwJCOvCMyDnxMR@Pu0QWwN81zxxGMxT05UzVDpIEwtte4PkYwi4f3kNBEEAvP7tCuYUWtU8vEaudAk36PnjWBZFaUhJGTDqir8pElKWCmq@U4S4r0zgWtEz0iRWfPMK0PE4tZoepfipfqOGuNhIMnbfRMMBgHsMNhI/chuB736kQd/2PnuURRXOElgtqvFll/Hq8EVQxIaNuJcsxBz3x6gQailDQnDBrRSGjGYxId@LT4Rn9hpXiithXYY4pCvqFNwTOyeARb1y847p18IwMQ20bWjKrZ5O/3tN4DVtHrv6PXO51ubWrbfjiL3g3dr6CLf6Nkf/k7Xf2OmWFbeMHqWLNDJfujVtufwA "C++ (clang) – Try It Online")
input: `lily = -1, water = 0`
### gcc-specific (abusing UB):
# [C++ (GCC)](https://gcc.gnu.org), 89 bytes
```
int f(auto p,int s){int i=s,j,a,r=0;for(;a=i;r|=a)for(j=--i;j<p.size();j+=s)a&=p[j];s=r;}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=lZLfSsMwFMbBu-YpDhVcg9nonE5Z2nnlrffDiZQ2GylbU5K0iHNP4s1uvJQ9jz6NTSOu-4dIEw7nO-eX8zXt20eczwpl9tM0jler90JP2jefI55pmHhRoQXkxCQKL0zgoSIpiYgMfToR0qNRyKl8DSNssjRstzlNg7yj-AvzME3PQ4WjszB_SB-pCiVd2gFfJ-tTnsWzImEQcKG0ZNF8iDZayWIt5BChUvAEaaa0p3QyGFg9qKwMIRdZQqA2pyVPGIG6xSTZFNhzXvVitEBOLcei0BAE4N7VBZYMwDW57UOO40BdHuup0D81b-LZIXYAhltwR0y5UNXvhYtNT2uctShaIlQZQfOIZ56xvJnbdFxShJyyEynFp5m3AJ-Y1e7a7f-Ghtgo1iosMUVOfSElgR6xhvDOwQeO2wYviH2DfUMbprl2-esjg7ewbaT_f-TqqMu9u9qHL_-CD2O9BiaZLmQGfvV97X-7WvdQH_kV062eKlr5Gw)
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), 14 bytes
```
Ｎθ¬⌊Ｅθ№✂ηιＬηθ0
```
[Try it online!](https://tio.run/##S85ILErOT8z5/98zr6C0xK80Nym1SKNQ05oroCgzr0TDN7EiM7c0F0gXaBTqKPhm5oG5wTmZyakaGToKmToKPql56SUZGhmaOgqFmiBg/f@/MZeBgaGhgSGINASR/3XLcgA "Charcoal – Try It Online") Link is to verbose version of code. Takes the jump size as the first parameter and the pond as the second parameter and outputs a `1` if the pond can be crossed, `0` if not. Explanation: Based on @MatteoC's Python answer.
```
Ｎθ              First input as a number
     θ          First input
    Ｅ           Map over implicit range
      №         Count of
             0  Literal string `0` in
        η       Second input
       ✂        Sliced from
         ι      Current index to
           η    Second input
          Ｌ     Length
            θ   In steps of first input
   ⌊            Take the minimum
  ¬             Logical Not i.e. is zero
                Implicitly print
```
I tried porting @UnrelatedString's Jelly answer but the best I could do was also 14 bytes:
```
Ｎθ‹υ⁻…⁰θ﹪⌕Ａη0θ
```
[Try it online!](https://tio.run/##S85ILErOT8z5/98zr6C0xK80Nym1SKNQ05oroCgzr0TDJ7W4WKNUR8E3M6@0WCMoMS89VcNAR6FQEyiUn1Kak6/hlpmX4piTo5Gho6BkoKQJkgMC6///jbkMDAwNDQxBpCGI/K9blgMA "Charcoal – Try It Online") Link is to verbose version of code. Takes the jump size as the first parameter and the pond as the second parameter and outputs a Charcoal boolean, i.e. `1` if the pond can be crossed, nothing if not. Explanation:
```
Ｎθ              First input as a number
   υ            Predefined empty list
  ‹             Is less than
     …          Range from
      ⁰         Literal integer `0` to
       θ        First input
    ⁻           Remove elements from
         ⌕Ａ     Find all occurrences of
            0   Literal string `0`
           η    In second input
        ﹪       Vectorised modulo
             θ  First input
```
[Answer]
# [Perl 5](https://www.perl.org/) `-pl`, 49 bytes
```
$l=<>-1;$_=/^.{0,$l}(.{$l}1)+.{0,$l}$/||$l>=y///c
```
[Try it online!](https://tio.run/##K0gtyjH9/18lx9bGTtfQWiXeVj9Or9pARyWnVkOvGkgaampD@Sr6NTUqOXa2lfr6@sn//xuAAZfZv/yCksz8vOL/ur6megaGBv91C3IA "Perl 5 – Try It Online")
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 44 bytes
```
Length[{}⋃Flatten@#~Position~0~Mod~#2]<#2&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n2b73yc1L70kI7q69lF3s1tOYklJap6Dcl1AfnFmSWZ@Xp1BnW9@Sp2yUayNspHa/4CizLwSBQeFtOhqAx0DHUMgNABjCNsQxq7VUTCO5UJSjaSuVscIRQomAYNABeZoCqCwVscMQwJmOVjaBIs0VMo49j8A "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 62 bytes
```
.+$
$*
^(?=.*¶1(1)*)(?<-1>.)*((?(3)^)1(?=.*¶1(1)*)(?<-3>.)*)*¶
```
[Try it online!](https://tio.run/##K0otycxL/K@qEZyg819PW4VLRYsrTsPeVk/r0DZDDUNNLU0NextdQzs9TS0NDXsNY804TUMMaWOQtCZQ6P9/AwNDQwNDEGkIInWMuSBcHSMuEA0ChjrmXGCGjhmQNgQjHRMA "Retina 0.8.2 – Try It Online") Takes pond and jump size on separate lines but link is to test suite that splits on comma for convenience. Explanation:
```
.+$
$*
```
Convert the jump size to unary.
```
^(?=.*¶1(1)*)(?<-1>.)*
```
At the start of the pond, match up to (but not including) the jump size number of digits, then...
```
((?(3)^)1(?=.*¶1(1)*)(?<-3>.)*)*¶
```
... repeatedly match a `1` plus up to the jump size number of digits for the last repeat before the end of the pond, except that the condition at the beginning of the repeat means that the maximum number of digits must have been matched on all the previous repetitions.
[Answer]
# Desmos, some bytes
```
t(V)=V.length
R(V)=[sign(t(V)-i+.2)/2+.5fori=[1...t(V)+100]]
X(V)=[1-R(V)[j]+R(V)[j]V[jR(V)[j]+1-R(V)[j]]forj=[1...t(V)+100]]
f(V,z)=∑_{y=1}^z∏_{v=1}^{floor((t(V)-y+z)/z)}[X(V)[y+kz]fork=[0...(t(V)-z+10-y)/z]][v]
```
[Answer]
# [Scala](https://www.scala-lang.org/), 89 bytes
Golfed version. [Try it online!](https://tio.run/##RZBBS8QwEIXv/RWPXnYCdWlUFMpmQTwJehJP4iG7pjUlmw1NFJdlf3udtAWHZOB9ZPJeEvfa6fG4680@4UVbj/P4aVq05Jsnn6rQvKbB@k4oqvHtk3XwYm1@bUyRrNqSXWhYO@O79IXdKZ9oj4N2jnq1DdQLpVZyJcQI5LsPbEN66GKDh2HQp/fZ4kM0ePM2QeFcgOtHOyQT06OOJjJ9ZlOisq6lrGXuMveywo2oQOUMWV5PMqtcmdzPJBeru0XJaTG4FaKYHDk1iELFL8Dm6t9cLImAwEmT88T/UyHwXIaXIu/L@Ac)
```
def f(n:Int,p:String)=(0 until n).exists(i=>(i until p.length by n).forall(j=>p(j)=='1'))
```
Ungolfed version. [Try it online!](https://tio.run/##RZBBS8QwEIXv/RWPXnYCdWlUFIoV1IuCnsSTeMiu2W5KTEMTxUX2t9dJWjQkA@8x5HszYausmqZh0@ttxJMyDj8F8K538Pcq7Mk1eHCxgm/wHEfjOtHgdhisVg5t7gWoxqeLxsKJtf42IQYyaK/Bdfb92mrXxT02h9SzG0ZlLfWpx1Mv0LZYyZUQ/NuxWPAfnIXU2IUGN@OoDq8z/o35L87EP/iXsog6xDsVdGD3kflEZV1LWctUZaplhTNRgcrZZHmaZVLpJOdydtJhdbEomS8b55wvEzk@iHzFo@Dq5B8ulkSA56TROlpWyNvLs6Xp0jsW0/QL)
```
object Main {
  def pHash(n: Int, p: String): Boolean = {
    (0 until n).exists(i => (i until p.length by n).forall(j => p(j) == '1'))
  }
  def main(args: Array[String]): Unit = {
    val testCases = List(("001101001111001", 3), ("101001", 2), ("010000001", 7), ("00000", 6), ("00100100", 4))
    for ((p, n) <- testCases) {
      println(pHash(n, p))
    }
  }
}
```
[Answer]
# [Uiua](https://uiua.org) [SBCS](https://tinyurl.com/Uiua-SBCS-Jan-14), 6 bytes
```
>⧻◴◿,⊚
```
[Try it!](https://uiua.org/pad?src=0_8_0__ZiDihpAgPuKnu-KXtOKXvyziipoKCmYgWzEgMSAwIDAgMSAwIDEgMSAwIDAgMCAwIDEgMSAwXSAzCmYgWzAgMSAwIDEgMSAwXSAyCmYgWzEgMCAxIDEgMSAxIDEgMSAwXSA3CmYgWzEgMSAxIDEgMV0gNgpmIFsxIDEgMCAxIDEgMCAxIDFdIDQK)
Port of UnrelatedString's [Jelly answer](https://codegolf.stackexchange.com/a/247303/97916).
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 49 bytes
```
n=>k=>eval(`/^((.|^|$){${n-1}}(1|$))*$/`).test(k)
```
[Try it online!](https://tio.run/##dY5RC4IwFIXf@xVj@HBvoHMV9aQ/ofdexGEzyrFFE1/U3742JanAw@XAge8ezkN0wlav@7ONtblKV2dOZ3mT5bITCkpWACRDMUTYR72O@TgC9wG3ESsxaaVtoUFXGW2NkokyN6hhj0DTlPOUB@fBKSJhjNCLtHTzS@88PaMUyUczfTb/8ClUezZo4Verj9MQr6/mdfowz55ueViGuDc "JavaScript (Node.js) – Try It Online")
]