I'm given a question:
Oxidation number of $\ce{O}$ in $\ce{BaO2}$ is $x$ and in $\ce{OF2}$ is $y$; then the value of $x+y$ is what?
Now my main question is that if $\ce{F}$ has $-1$ valency in $\ce{OF2}$ then $\ce{O}$ must have valency of $+2$. But is that possible since $\ce{O}$ mainly has oxidation states of $-1$ & $-2$ or am I making any mistake?