integer is used to constrain a variable to be integer.
The integrality constraint is imposed on the involved variables, not the actual expression. Hence, the following two constraints are equivalent.
If possible, use intvar instead as there are some parts in YALMIP where it can exploit integrality on an earlier stage if the varaibles have been defined as such.