Necessary and sufficient optimality conditions for fractional Fornasini-Marchesini model