#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
#include<vector>
#include<set>
using namespace std;
#define MAXN 1010
#define MAXE MAXN*MAXN*2
#define MAXV MAXN
struct Edge
{
int np;
Edge *next;
}E[MAXE],*V[MAXV];
int tope=-1;
void addedge(int x,int y)
{
E[++tope].np=y;
E[tope].next=V[x];
V[x]=&E[tope];
}
bool vis[MAXN];
int deg[MAXN];
priority_queue<pair<int,int> > PQ;
vector<int> seq;
int rk[MAXN];
set<pair<int,int> > S;
int main()
{
freopen("input.txt","r",stdin);
int n,m;
scanf("%d%d",&n,&m);
int x,y;
for (int i=0;i<m;i++)
{
scanf("%d%d",&x,&y);
if (S.find(make_pair(x,y))!=S.end())continue;
addedge(x,y);
addedge(y,x);
S.insert(make_pair(x,y));
S.insert(make_pair(y,x));
}
PQ.push(make_pair(0,1));
while (!PQ.empty())
{
Edge *ne;
pair<int,int> pr=PQ.top();
PQ.pop();
if (vis[pr.second] || deg[pr.second]!=pr.first)continue;
seq.push_back(pr.second);
vis[pr.second]=true;
for (ne=V[pr.second];ne;ne=ne->next)
{
if (!vis[ne->np])
{
deg[ne->np]++;
PQ.push(make_pair(deg[ne->np],ne->np));
}
}
}
if (seq.size()!=n)
{
// printf("Imperfect\n");
// return 0;
}
for (int i=0;i<seq.size()/2;i++)
swap(seq[i],seq[seq.size()-1-i]);
for (int i=0;i<seq.size();i++)
rk[seq[i]]=i;
vector<int> vec;
for (int i=0;i<seq.size();i++)
{
int now=seq[i];
Edge *ne;
vec.clear();
for (ne=V[now];ne;ne=ne->next)
{
if (rk[ne->np]>rk[now])
{
vec.push_back(rk[ne->np]);
}
}
sort(vec.begin(),vec.end());
for (int i=0;i<vec.size();i++)
vec[i]=seq[vec[i]];
for (int i=1;i<vec.size();i++)
{
if (S.find(make_pair(vec[0],vec[i]))==S.end())
{
printf("Imperfect\n");
return 0;
}
}
}
printf("Perfect\n");
}