using System;
class Program
{
    static bool ProstBroj(int n)
    {
        for(int i = 3; i * i < n; i++)
        {
            if (n % i == 0)
                return false;
        }
        return true;
    }
    static void Main(string[] args)
    {
        string[] unos = Console.ReadLine().Split();
        string[] unos2 = Console.ReadLine().Split();
        int n = Convert.ToInt32(unos[0]);
        int k = Convert.ToInt32(unos[1]);
        int[] niz = new int[k];
        for(int i = 0; i < k; i++)
            niz[i] = Convert.ToInt32(unos2[i]);
        if(ProstBroj(n)&&k==2)
            Console.WriteLine(1^n);
        else
            Console.WriteLine("nije");
    }
}