program put;
const
nn=1206;
var
i,n,a,b,c:longint;
procedure init;
begin
assign(input,'put.in');
reset(input);
assign(output,'put.out');
rewrite(output);
read(n)
end;
procedure panduan;
begin
if n=1 then
begin
writeln('No Solution!');
close(input);
close(output);
halt
end
end;
procedure main;
begin
a:=0;
b:=1;
for i:=3 to n do
begin
c:=((i-1)*(a+b)) mod nn;
a:=b;
b:=c
end;
writeln(b);
close(input);
close(output)
end;
begin
init;
panduan;
main
end.