Prime Factor Encoding How the encoding works

Given a list of bits:


Hold a prime (starting with 2)
Have a list
For each bit in the input


If it's the same as the previous bit, add the prime you're holding to the list
If it's different, hold the next prime and add that to the list

Return the product of all the numbers in your list
For the first bit, assume the previous bit was 0



  Note: these steps are for illustration purposes only, you are not required to follow them.


Examples

Input: 001
hold 2

0:         add 2 to the list
0:         add 2 to the list
1: hold 3, add 3 to the list

list: 2,2,3
Output: 12




Input: 1101
hold 2

1: hold 3, add 3 to the list
1:         add 3 to the list
0: hold 5, add 5 to the list
1: hold 7, add 7 to the list

list: 3,3,5,7
Output: 315


Some more examples:

000000000 -&gt; 512
111111111 -&gt; 19683
010101010 -&gt; 223092870
101010101 -&gt; 3234846615
011101101 -&gt; 1891890
000101101010010000 -&gt; 3847834029582062520


Challenge

Write an encoder and a decoder for this encoding method.

(The decoder reverses the process of the encoder).

Input / Output


The encoder can take input in any reasonable format
The encoder must output either an integer or a string
The decoder must take input in the same format that the encoder outputs
The decoder must output the same format that the encoder takes as input


In other words decoder( encoder( input ) ) === input

Notes


The decoder may assume that its input is decodable
Your answer only has to deal with integers that your language can natively support without using (long, bigInt, etc.), be reasonable, if you language only supports ints up to 1, maybe reconsider posting an answer


Scoring

Your score is the sum of the lengths in bytes of the encoder and decoder.

If you need to import a module, the import can be counted only once provided that your encoder and decoder can coexist in the same file and be reused (like functions).

Default loopholes are forbidden.

This is code-golf so the shortest score for every language wins.
05AB1E, 13 bytes

Encoder, 8 bytes

0ì¥ĀηOØP


Try it online!

Explanation

0ì          # prepend 0 to input
  ¥         # calculate deltas
   Ā        # truthify each
    η       # calculate prefixes
     O      # sum each
      Ø     # get the prime at that index
       P    # product


Decoder, 5 bytes

Ò.ØÉJ


Try it online!

Explanation

Ò       # get prime factors of input
 .Ø     # get their indices among the primes
   É    # check for oddness
    J   # join