Create a function which checks if a binary number is divisible by three by implementing the following [finite-state automaton] (https://en.wikipedia.org/wiki/Finite-state_machine):

The function should implement the following commands:
0, 1 ➞ The next digit in the number."state" ➞ The automaton's current state: "S0", "S1", or "S2"."stop" ➞ Whether the automaton accepts or rejects the number that's been given. The function should either return "accept" or "reject".divisible(1)(1)(0)(1)(0)("stop") ➞ "reject"
# 26 is not divisible by 3, and 26 == 0b11010
divisible("state") ➞ "S0"
# The automaton should start at S0
divisible(1)(0)(1)("state") ➞ "S2"
"state" or "stop" command."S0", whereas rejection occurs if the state at termination is "S1" or "S2".