In triangle $ABC$,
\[2a^2 + 4b^2 + c^2 = 4ab + 2ac.\]Compute the numerical value of $\cos B.$The answer is in the form rac{m}{n}, where gcd(m, n) = 1. Please provide the value of m + n.

Let's think step by step and output the final answer within \boxed{}.
user