Let's define a data set as a non-decreasing sequence of integers $$$A = (a_1, a_2, \ldots, a_n)$$$.
A bar chart is a graphical representation of a data set, consisting of several rectangles of varying heights, positioned adjacent to each other. The bar chart $$$H_{k,b,s}(A)$$$ consists of $$$k$$$ rectangles, where the height of the $$$i$$$-th rectangle, denoted as $$$h_i$$$, equals the count of values from the data set $$$A$$$ that fall within the half-interval $$$[b + (i-1)s, b + is)$$$, for $$$1 \leq i \leq k$$$. The parameters $$$k$$$, $$$b$$$, and $$$s$$$ must be chosen such that all values from the data set are taken into account; specifically, it must hold that $$$b \leq a_1$$$ and $$$a_n \lt b + ks$$$.
It is clear that different values of $$$k$$$, $$$b$$$, and $$$s$$$ can produce various bar charts for the same data set $$$A$$$. For instance, for the data set $$$A = (4, 7, 7, 11, 13, 14, 18)$$$, the bar charts $$$H_{4,1,5}(A)$$$ and $$$H_{4,4,4}(A)$$$ look as follows:
You are given two bar charts. Your task is to determine whether they could originate from the same data set.
The first and second lines describe the first bar chart. The first line contains the parameters $$$k$$$, $$$b$$$, and $$$s$$$ ($$$1 \leq k,b,s \leq 100$$$), while the second line contains $$$k$$$ integers, where the $$$i$$$-th integer reflects the height of the $$$i$$$-th rectangle $$$h_i$$$ ($$$0 \leq h_i \leq 100, 1 \leq i \leq k$$$).
The third and fourth lines provide the description of the second bar chart in the same format.
If both bar charts could have been generated from some data set, output "Yes". Otherwise, output "No".
4 1 51 2 3 14 4 43 1 2 1
Yes
4 1 51 1 4 14 4 43 1 2 1
No