I was checking if $M_3$ and $N_5$ are modular.

So first is pentagon lattice. I am checking whether $a\vee (b\wedge c)=(a\vee b)\wedge c$.
Now for $N_5$, we have $a\le c$. So
$a\vee(b\wedge c)=a\vee 0=a$ and $(a\vee b)\wedge c=1\wedge c=c$.
So $a\vee (b\wedge c)\ne (a\vee b)\wedge c$ and hence $N_5$ is not modular.
But $a,b,c$ are pairwise incomparable in $M_3$. Means no $a\le c$. So how can $M_3$ be modular?
I know I'm doing something wrong. Thanks for any help.
You should use different letters for the variables.
We need to verify $x\lor(y\land z)=(x\lor y)\land z$ whenever $x,y,z\in M_3$ and $x\le z$.
You can easily check that the identity holds in any lattice if any two of $x,y,z$ coincide, or if $x=0$ or $z=1$.
Since in $M_3$ all the comparable pairs $x\le z$ with $x\ne z$ include either $0$ or $1$, indeed there's nothing else to check.